title: How to perform a hierarchical LINQ to XML query?
body: <p>I know I can do this iteratively, but it would be cool to do it in a single LINQ statement.</p>
  
  <p>I have some XML that looks like this:</p>
  
  <pre><code>&lt;parent name="george"&gt;
    &lt;child name="steve" age="10" /&gt;
    &lt;child name="sue" age="3" /&gt;
    &lt;pet type="dog" /&gt;
    &lt;child name="jill" age="7" /&gt;
  &lt;/parent&gt;
  &lt;!-- ... --&gt;
  </code></pre>
  
  <p>and I want to write a LINQ to XML statement to turn it into</p>
  
  <pre><code>&lt;node type="parent" label="george"&gt;
    &lt;node type="child" label="steve" years="10 /&gt;
    &lt;node type="child" label="sue" years="3" /&gt;
    &lt;node type="child" label="jill" years="7" /&gt;
    &lt;!-- no pets! --&gt;
  &lt;/parent&gt;
  &lt;!-- ... --&gt;
  </code></pre>
  
  <p>Is that possible in a single LINQ to XML statement? </p>
  
  <p>I've included two <code>from</code> statements in a LINQ statement before, but not a second <code>select</code>, which seems to be what this would require. </p>