title: Unable to get xml node from XElement
body: <p>I really need help with the where clause below. </p>
  
  <p>Consider this xml </p>
  
  <pre><code>&lt;name xmlns="http://www.imsglobal.org/xsd/imslip_v1p0"&gt;  
  &lt;partname&gt;  
    &lt;typename&gt;  
      &lt;tyvalue&gt;First&lt;/tyvalue&gt;  
    &lt;/typename&gt;  
    &lt;text&gt;Charles&lt;/text&gt;
  &lt;/partname&gt;  
  &lt;partname&gt;  
     &lt;typename&gt;  
         &lt;tyvalue&gt;Last&lt;/tyvalue&gt;  
      &lt;/typename&gt;  
      &lt;text&gt;Ward&lt;/text&gt;  
    &lt;/partname&gt;  
  &lt;/name&gt;
  </code></pre>
  
  <p>This code returns one element </p>
  
  <pre><code>List&lt;XElement&gt; xElements = xmlDocument.Descendants(Aw + "name").
  Where(x =&gt; (x.Element(Aw + "partname").Element(Aw + "typename").Element(Aw + "tyvalue")).Value == "First").
  Select(x =&gt; x.Element(Aw + "partname").Element(Aw + "text")).ToList();
  </code></pre>
  
  <p>But if I change the where clause to "Last", it returns zero elements. </p>
  
  <pre><code>List&lt;XElement&gt; xElements = xmlDocument.Descendants(Aw + "name").
  Where(x =&gt; (x.Element(Aw + "partname").Element(Aw + "typename").Element(Aw + "tyvalue")).Value == "Last").
  Select(x =&gt; x.Element(Aw + "partname").Element(Aw + "text")).ToList();
  </code></pre>
  
  <p>Please help. I'm really stuck. </p>