Some apps, especially apps used with existing systems, need to be able to parse and generate XML.
For this recipe, we need to have an existing XML file stored in the
Assets folder. The structure of the XML file that we will use in this recipe is as follows:
<?xml version="1.0" encoding="UTF-8"?> <bookshelf> <book title="book title"> <authors> <author firstname="name" lastname="surname"/> <author ... /> </authors> </book> <book>...</book> </bookshelf>
There are many ways to handle XML, but in this recipe, we will use Language-Integrated Query (LINQ) to XML. One of the most common things to do with XML is to read it, usually from a remote source. Let's take a look at the following ...