title: return list of Xelement names
body: <p>I got an XDocument structure as below :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;body&gt;
   &lt;ControlSettings&gt;
    &lt;Manual-B nudA="20" nudB="3" nud=D"4"  /&gt;
    &lt;Manual-A nudA="2" nudB="33" nudD="4"  /&gt;
    &lt;Manual-C nudA="20" nudB="20" nudD="40" /&gt;
    &lt;another value="true"  /&gt;
   &lt;/ControlSettings&gt;
   &lt;Score&gt;
    &lt;Manual-F result="fail" /&gt;
   &lt;/Score&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I am trying yo get out a sorted list of only the names in controlsettings So that string list should contain :</p>
  
  <ul>
  <li>another</li>
  <li>Manual-A</li>
  <li>Manual-B</li>
  <li>Manual-C</li>
  </ul>
  
  <p>How to do that with Xdocuments using xpath / linq ?
  I tried below but it doesnt seam to work</p>
  
  <pre><code>IEnumerable &lt;string&gt; names =  doc.XPathSelectElements
  ("..//body//ControlSettings").Select(e =&gt; e.Name.LocalName);
     /* other things i tried:
     List&lt;string&gt;mnames = doc.Root.Element("..//controlsettings").
     var query = from x in doc.Descendants("//body//ControlSettings")
      */
   foreach (string localname in names)Console.WriteLine(localname);
  </code></pre>