title: Sorting XML file by a subtag?
body: <p>I'm not a programmer (anymore).
  I'm working with my windows media center PC, and trying to cut down the garbage in the mcechannelinfo.xml.</p>
  
  <p>Easy enough to remove the other providers (cable carriers that I don't use), but now I'm in my provider trying to sort/remove the channels I don't get.</p>
  
  <p>The data is sorted like this:</p>
  
  <pre><code>    &lt;channel&gt;
        &lt;id&gt;Atlanta, DISH Atlanta::ZBUSN::mcepg&lt;/id&gt;
        &lt;name&gt;ZBUSN&lt;/name&gt;
        &lt;num&gt;708&lt;/num&gt;
        &lt;subnum&gt;0&lt;/subnum&gt;
      &lt;/channel&gt;
      &lt;channel&gt;
        &lt;id&gt;Atlanta, DISH Atlanta::KIDTV::mcepg&lt;/id&gt;
        &lt;name&gt;KIDTV&lt;/name&gt;
        &lt;num&gt;9394&lt;/num&gt;
        &lt;subnum&gt;0&lt;/subnum&gt;
      &lt;/channel&gt;
      &lt;channel&gt;
        &lt;id&gt;Atlanta, DISH Atlanta::WSBK::mcepg&lt;/id&gt;
        &lt;name&gt;WSBK&lt;/name&gt;
        &lt;num&gt;8775&lt;/num&gt;
        &lt;subnum&gt;0&lt;/subnum&gt;
      &lt;/channel&gt;
      &lt;channel&gt;
        &lt;id&gt;Atlanta, DISH Atlanta::BLOCK::mcepg&lt;/id&gt;
        &lt;name&gt;BLOCK&lt;/name&gt;
        &lt;num&gt;349&lt;/num&gt;
        &lt;subnum&gt;0&lt;/subnum&gt;
      &lt;/channel&gt;
  </code></pre>
  
  <p>As you can see, that's a mess.  It's neither alphabetical by channel name, nor numerical by number!!</p>
  
  <p>How can I sort the data by name or even better, by number?
  I have access to few tools - Excel, notepad++, and another program I grabbed called XMLMIND...</p>
  
  <p>Please help!</p>
  
  <p>Ok. I tried your response and it didn't seem to work, so I'm pasting a bigger clip from the top of the XML so you can see everything.</p>
  
  <pre><code>?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Channels&gt; 
   &lt;category name="Atlanta, DISH Atlanta"&gt;
      &lt;channel&gt;
        &lt;id&gt;Atlanta, DISH Atlanta::ESPNA::mcepg&lt;/id&gt;
        &lt;name&gt;ESPNA&lt;/name&gt;
        &lt;num&gt;148&lt;/num&gt;
        &lt;subnum&gt;0&lt;/subnum&gt;
      &lt;/channel&gt;
      &lt;channel&gt;
        &lt;id&gt;Atlanta, DISH Atlanta::FSP::mcepg&lt;/id&gt;
        &lt;name&gt;FSP&lt;/name&gt;
        &lt;num&gt;391&lt;/num&gt;
        &lt;subnum&gt;0&lt;/subnum&gt;
      &lt;/channel&gt;
      &lt;channel&gt;
        &lt;id&gt;Atlanta, DISH Atlanta::ACMAX::mcepg&lt;/id&gt;
        &lt;name&gt;ACMAX&lt;/name&gt;
        &lt;num&gt;313&lt;/num&gt;
        &lt;subnum&gt;0&lt;/subnum&gt;
      &lt;/channel&gt;
      &lt;channel&gt;
        &lt;id&gt;Atlanta, DISH Atlanta::TBSHD::mcepg&lt;/id&gt;
        &lt;name&gt;TBSHD&lt;/name&gt;
        &lt;num&gt;139&lt;/num&gt;
        &lt;subnum&gt;0&lt;/subnum&gt;
      &lt;/channel&gt;
  </code></pre>
  
  <p>Your assistance is greatly appreciated, in advance.</p>