This is because you have two options in reading XML files in .net - you can use a XmlDocument or an XmlReader/XmlWriter.
The XmlDocument is way easier, but since it loads the entire file into memory (and constructs an in-memory tree representation of your document) it's slow and consumes a lot of memory. So it's best used for files less that 500kb or so (that's just a number I made up - your experience may indicate a different one). You would load the file into your XmlDocument, and append your new nodes using CreateElement and AppendChild methods.
The XmlReader/XmlWriter are actually abstract base classes - you'll actually need to instantiate one of XmlTextReader, XmlValidatingReader, or XmlNodeReader. In the case of a writer, you'll use XmlTextWriter.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.