Everytime I see a developer coming from Visual Basic or Javascript doing some XML developemnt I get a question: How do I import a XmlNode from a different XmlDocument?
Here is the short answer:
XmlDocument newXml = new XmlDocument(); XmlDocument oldXml = new XmlDocument(); ... XmlNode oldNode = oldXml.DocumentElement.ChildNodes[0]; // f.e. XmlNode importXml = newXml.ImportNode(oldNode, true); newXml.DocumentElement.AppendChild(importXml);