Creating XML with Visual Basic

  • 1
  • April 15, 2011
Julian Kay

Julian Kay


I’m of the opinion that you should use the right tool for the job. In the case of making simple XML files from data in another source, the XML literals feature in Visual Basic works very well and tends to be my first choice.

Check out how simple creating XML documents can be:

Running this code just outputs a simple XML file which looks like this:

As you can see, the output and the code look very similar, and while you could create something like this in C# by using the equivalent XElement objects, it will never look as simple to me. Maybe one day we’ll get these pretty XML literals in C# too?

Free of charge. Unsubscribe anytime.