title: For an XDocument descendants operation how can only return immediate child nodes?
body: <p>For an XDocument descendants operation how can only return immediate child nodes?</p>
  
  <p>I have an operation along the lines of:</p>
  
  <pre><code>XDocument xmlDc = XDocument.Load(dependencyFilePath);    
  IEnumerable&lt;IGrouping&lt;string, XElement&gt;&gt; scriptNodes = 
  from s in xmlDc.Descendants("script") select s;
  </code></pre>
  
  <p>The problem is my XML doc is structured as follows</p>
  
  <pre><code>&lt;topNode&gt;
   &lt;script&gt;
      &lt;someNode&gt;...&lt;/someNode&gt;
      &lt;script&gt;....&lt;/script&gt;
   &lt;/script&gt;
  &lt;/topNode&gt;
  </code></pre>
  
  <p>Essentially, script tags can have child scrip tags, but when I do Descendents, I only want to retrieve immediate child node, not grandchild script nodes.</p>
  
  <p>Is this possible with XDocument? Can I use a predicate to somehow check if a potential selectee has for parent the node I am checking from to accomplish this?</p>