Moving nodes from one XmlDocument to another
Here's how to move all the nodes from one Xml Document to another:
1 2 // Dont forget this one: 3 using System.Xml; 4 5 // First, get some documents together 6 XmlDocument DocumentSource = new XmlDocument(); 7 XmlDocument DocumentDestination = new XmlDocument(); 8 9 // Load the documents with some nodes 10 DocumentSource.LoadXml(""); 11 DocumentDestination.LoadXml(""); 12 13 // Now to do the conversion 14 XmlNode tempNode = DocumentDestination.ImportNode( DocumentSource.FirstChild ) 15 16 // Now insert the fragment into the document 17 DocumentDestination.FirsChild.AppendChild(tempNode);