title: LINQ - simple select based on value of child element
body: <p>I have a problem here which i can solve using Xpath with c#. However I am trying to do it via LINQ and i am just not able to figure out how to do it.
  I have a repeating Group2 which has several child nodes. I want to select "Group2" based on the value of an element in group 2 descendants.
  thx for the help in advance. here is a sample xml.</p>
  
  <pre><code>&lt;Receive&gt;
  &lt;Idoc&gt;
      &lt;EDI_DC40&gt;
          &lt;TabName&gt;EDI_DC40&lt;/TabName&gt;
      &lt;/EDI_DC40&gt;
      &lt;Group1&gt;
          &lt;Group2&gt;
              &lt;Group3&gt;
                  &lt;SelectGroup2BasedonValueofThisNode&gt;001&lt;/SelectGroup2BasedonValueofThisNode&gt;
              &lt;/Group3&gt;
          &lt;/Group2&gt;
          &lt;Group2&gt;
              &lt;Group3&gt;
                  &lt;SelectGroup2BasedonValueofThisNode&gt;002&lt;/SelectGroup2BasedonValueofThisNode&gt;
              &lt;/Group3&gt;
          &lt;/Group2&gt;
          &lt;Group2&gt;
              &lt;Group3&gt;
                  &lt;SelectGroup2BasedonValueofThisNode&gt;003&lt;/SelectGroup2BasedonValueofThisNode&gt;
              &lt;/Group3&gt;
          &lt;/Group2&gt;
      &lt;/Group1&gt;
  &lt;/Idoc&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>var _selectedGroup = document.Descendants("Group2");
  </code></pre>
  
  <p>This selects all the Group2 -- but what next i am not sure how to put the where or select. </p>
  
  <pre><code>var element = _cloneDocument.Descendants("Group2").Where(x =&gt; x.Value == "001");
  </code></pre>
  
  <p>well i just tried above code and it seems to work. My next question -- is this the right way to do it? Or there is another more recommended way to do this.</p>