title: Help sorting XML Data in .NET (maybe with LINQ query?)
body: <p>I have this hierarchy of XML</p>
  
  <pre><code>  &lt;Chapters&gt;
     &lt;Chapter @num=""&gt;
      &lt;Section @letter=""&gt;
       &lt;Heading @num="" /&gt;
      &lt;/Section&gt;
     &lt;/Chapter&gt;
    &lt;/Chapters&gt;
  </code></pre>
  
  <p><strong>I need to do a sort so that all chapters are sequenced in ascending order, each section within that chapter is sequenced in ascending order, and each heading in that section is sorted...</strong></p>
  
  <p>Doing the following yields the Chapters sorted properly, but obivously the child data isn't sorted:</p>
  
  <pre><code>Dim chapsorted = From c In root.Elements
                   Order By c.@num Ascending
                   Select c
  </code></pre>
  
  <p><br />
  <br />
  <br /></p>
  
  <p>From there I'm lost.   I tried this crazy thing to get the full results I want, but that didn't do me any good either: </p>
  
  <pre><code>Dim chapsorted = From c In root.Elements
               Order By c.@num Ascending
               Select (From sec In c.Elements Order By sec.@letter Where sec.Parent Is c Select
                      (From hed In sec.Elements Order By hed.@num Where hed.Parent Is sec)))
  </code></pre>
  
  <p>That did me no good either.</p>
  
  <p>There has got to be a simple way of doing this.... :-)  Help will be greatly appreciate, I've been spinning my wheels for hours.</p>