title: LINQ to XML: how do I get only direct descendants of an XElement?
body: <pre><code>Dim xml = &lt;Root&gt;
              &lt;Parent id="1"&gt;
                &lt;Child&gt;Thomas&lt;/Child&gt;
              &lt;/Parent&gt;
              &lt;Parent id="2"&gt;
                &lt;Child&gt;Tim&lt;/Child&gt;
                &lt;Child&gt;Jamie&lt;/Child&gt;
              &lt;/Parent&gt;
            &lt;/Root&gt;
  
  Dim parents = xml.Elements
  </code></pre>
  
  <p>In this case, <code>children</code> includes all the Parent elements and all of the Child elements.  What's the best way to grab <strong>only the direct descendants</strong> of <code>&lt;Root&gt;</code>?  </p>
  
  <p>Should I write a LINQ query that selects elements where parent = <code>&lt;Root&gt;</code>?  Or is there some built-in method I'm missing that can get this for me?</p>
  
  <p><strong>EDIT:</strong> I had some confusion between <code>XElement.Elements</code> and <code>XElement.Descendants</code>.  As Ruben Bartelink pointed out, <code>XElement.Elements</code> will give me exactly what I was looking for.</p>