I've faced with problem where I have to sort the XDocument by node name. Example
<contact>
<email></email>
<address></address>
<name></name>
</contact>
And I want to get
<contact>
<address></address>
<email></email>
<name></name>
</contact>
Thank you for your help.
I've tried to use
var ab = xdoc.Descendants("contact");
var s = from abs in ab
orderby abs.Name.ToString() descending
select abs;
but the result staying the same