You did not share how you represent Location and other detail, so you're on your own.
You can use the following approached to parse XML:
- Use
System.Xml.XmlDocument
class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^]. - Use the class
System.Xml.XmlTextReader
; this is the fastest way of reading, especially is you need to skip some data.
See http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^]. - Use the class
System.Xml.Linq.XDocument
; this is the most adequate way similar to that of XmlDocument
, supporting LINQ to XML Programming.
See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].
Now, do you have to read existing XML with already predefined schema, or you can generate your own? It would be much better. In this case, you should use serialization instead of doing it all on a level of XML.
The best really non-intrusive way to serialize is the
Data Contract.
See
http://msdn.microsoft.com/en-us/library/ms733127.aspx[
^].
See also my past answers where I argument in favor of this approach:
How can I utilize XML File streamwriter and reader in my form application?[
^],
Creating a property files...[
^].
—SA