title: LinQ GroupBy on nested element with same attributes
body: <p>I have the following xml output:</p>
  
  <pre><code>&lt;R N="1"&gt;
    &lt;MT N="Section" V="Section-1" /&gt;
    &lt;MT N="Person" V="John" /&gt;
  &lt;/R&gt;
  &lt;R N="2"&gt;
    &lt;MT N="Section" V="Section-1" /&gt;
    &lt;MT N="Person" V="Peter" /&gt;
  &lt;/R&gt;
  &lt;R N="3"&gt;
    &lt;MT N="Section" V="Section-2" /&gt;
    &lt;MT N="Person" V="Joseph" /&gt;
  &lt;/R&gt;
  </code></pre>
  
  <p>...
  ...</p>
  
  <pre><code>&lt;R N="N"&gt;
    &lt;MT N="Section" V="Section-J" /&gt;
    &lt;MT N="Person" V="PersonX" /&gt;
  &lt;/R&gt;
  </code></pre>
  
  <p>Im trying to compose a LinQ query to group all results  by section, using the section value as Key and the entire element  as element selector:</p>
  
  <pre><code>//MyElements its an IEnumerable&lt;XElement&gt;
  var something = MyElements.GroupBy
  (
     x =&gt; x.Elements("MT")
     .Where
     (
       type =&gt; type.Attribute("N").Value == "Section"
     )
     .Select
     (
       type =&gt; type.Attribute("V").Value
     )
     ,
     x=&gt;x
  );
  </code></pre>
  
  <p>When i debug my something variable doesn't contain elements. </p>
  
  <p>Any suggestion?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Jose</p>