I have an XML node structure in below format
<comments>
<comment lastupdated='12/08/2014:08:08:08' moderate='false'>
<id>user1</id>
<message>some message</message>
<replies>
<comment moderate='false'>
<id>user2</id>
<message>some other message</message>
</comment>
</replies>
</comment>
<comment lastupdated='13/08/2014:12:08:40' moderate='false'>
<id>user3</id>
<message>some message</message>
<replies>
<comment moderate='false'>
<id>user1</id>
<message>some other message</message>
</comment>
</replies>
</comment>
</comments>
I found this XML to LINQ solution XMLdocument Sort want to know if this can be also achieved through XPath so that I don't need to load a new assembly. Also I am little confused with attributes and child nodes? in terms of performance which one is better? fetch by attribute value or child node?
Update 1
The solution suggested by @Timothy in this link seems promising
var sortedItems = myDoc.GetElementsByTagName("item").OfType<XmlElement>()
.OrderBy(item => DateTime.ParseExact(item.GetAttribute("sTime"), "MM/dd/yyyy h:mm:ss tt", null));