Search code examples
c#asp.netxmlxmldocument

Import XmlNode into another XmlNode NOT XmlDocument


I know I can do this :

XmlNode newParent = UnitedXml.ImportNode(parentNode, true);
UnitedXml.AppendChild(newParent);

where unitedxml is an XmlDocument.

Now I want to import a child into "newParent" (Which does not have ImportNode method) from a different XmlDocument.

How do I do that ?


Solution

  •  XmlNode impertedNode = UnitedXml.ImportNode(x, true);
     newParent.AppendChild(impertedNode);
    

    this was a silly mistake. sorry.