Referencing the two questions here and here
I would like to sort on child nodes as well, but resetting for each "outer" node.
So:
<Root>
<I aa="1">
<s aa="3"/>
<s aa="1"/>
<s aa="2"/>
</I>
<I aa="5">
<s aa="3"/>
<s aa="1"/>
<s aa="2"/>
</I>
<I aa="3">
<s aa="3"/>
<s aa="1"/>
<s aa="2"/>
</I>
<I aa="4">
<s aa="3"/>
<s aa="1"/>
<s aa="2"/>
</I>
</Root>
Would become:
<Root>
<I aa="1">
<s aa="1"/>
<s aa="2"/>
<s aa="3"/>
</I>
<I aa="3">
<s aa="1"/>
<s aa="2"/>
<s aa="3"/>
</I>
<I aa="4">
<s aa="1"/>
<s aa="2"/>
<s aa="3"/>
</I>
<I aa="5">
<s aa="1"/>
<s aa="2"/>
<s aa="3"/>
</I>
</Root>
I tried different variations of the XDocument sorting, but I cannot get the syntax right.
Hoping someone can help, or provide me with an idea.