Yes. Inserting a node is fine.
But how about inserting a node at a particular place in the XML Tree.
Say an an XML Tree of a School, with Subjects, where each Subject has Classes, and Each Class has Students. Say deleting all students from the Anthropology Class <Class Name="athropology"> and moving another set of students there.
I find that i need to use a combination of .net classes (XPathNodeIterator & XPathNavigator )
I then create the iterator from the current position in the navigator.
I use the iterator to ask about this current position in navigator.
If it is the "right" position i use: XPatheNavigator.InnerXml
Or XPathNavigator.AppendChild(XmlNode);
You method of build child nodes from a start node can be used here.
You need need the XPathNavigator to find your way around. You use the XPathNodeIterator to ask questions about where you are in the Navigator.
You can for example can use XPathNavigator.ReadSubTree. Edit it. Then delete one level beneath , where you currently are in the Navigator (via the Interator), & then use the edite subtree to insert.
Does anybody have good for the above. I can supply what i have done. But i think there might be other ways to do it too.