There is no new version in each version. There are only two of them. Unfortunately, there should be two, but, of course, no more than two.
I recommend System.Xml.Linq.XDocument and its related classes. They provide a clean, useful API that allows the use of LINQ and Enumerable extension methods. Generating an XML tree in this API is easy because you can embed constructor calls and you get code that is very similar to XML itself.
One that I do not recommend is System.Xml.XmlDocument . It is old and it was designed to follow the W3C guidelines for the XML API. Therefore, it does not support any modern or C # -specific ideas, including enumerations and LINQ. Creating an XML tree in this API is tortuous: you need to create each element separately and call methods like AppendChild to turn them into a tree.
Timwi
source share