I load an XML document:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("MyFile.xml");
And also create a new document:
XmlDocument xmlDocSettings = new XmlDocument();
XmlNode xmlDecl = xmlDocSettings.CreateNode(XmlNodeType.XmlDeclaration, "", "");
xmlDocSettings.AppendChild(xmlDecl);
XmlElement root = xmlDocSettings.CreateElement("", "Test", "");
root.SetAttribute("TestAttribute", "AttributeValue");
xmlDocSettings.AppendChild(root);
Now I want to insert the content of xmlDoc
to xmlDocSettings
. How can I do that?
Thanks!