title: Data retrieving from XElemnt using LINQ
body: <p>I have an XElement as follows </p>
  
  <pre><code>&lt;row&gt;
    &lt;field name="field1"&gt;Test1&lt;/field&gt;
    &lt;field name="field2"&gt;Test2&lt;/field&gt;
    &lt;field name="field3"&gt;Test3&lt;/field&gt;
  &lt;/row&gt;
  </code></pre>
  
  <p>I want to retrieve value Test2 using the attribute value field2 using LINQ.I tried the following code </p>
  
  <pre><code>var data= item.Elements("field").Single(x =&gt; x.Attribute("name").Value == "field2");
  </code></pre>
  
  <p>It's not working.When I run the code it fails with error <strong>Sequence contains no matching element</strong> > </p>
  
  <p>I don't know what I'm missing here.How can I retrieve the value using LINQ</p>