A blog about one man's journey through code… and some pictures of the Peak District

Category Archives: XML

I recently saw a question on SO relating to this, and pretty much every answer was: “Use LINQ To Xml”. Which is good advice. If you don’t want to do that (for whatever reason), then you may decide to use an approach such as the following.

Disclaimer

I am not stating that this is the best was to accomplish this, merely that it is a way. I am also not asserting that any of the books mentioned exist in the libraries they are listed under.

The Code

Declare the XML string here. Note; if you intend to read this from a file then just call Xml.Load() later on, instead of LoadXml.