I know everyone says the best way to parse XML in C# is to use the XmlDocument class and do something like:
XmlNodeList list = xmlDoc.getElementsByTagName('tag');
However, I LOVE the way JavaScript encapsulates its XML and JSON, where every level of encapsulation within the XML or JSON document can be accessed using '.' i.e.:
test.xml
<item>
<title>Title</title>
<desc>
<meta>MetaData</meta>
<content>Ipsum Lorem</content>
</desc>
<date>1/1/2013</date>
</item>
In javasript I could parse this XML file and assign it to an object, var obj. I could then do something like:
obj.item[0].title ( 'Title' )
obj.item[0].desc.meta ('MetaData')
Is there any C# library that can parse the XML into something like this or do I have to do it the other way?
XDocumentand LINQ to XML.