title: Find XElement by Attribute value
body: <p>I have a collection of IEnumerables and each one has a different attribute values that corresponds to a different property on my business object. Here is a sample of the XML that I am querying against:</p>
  
  <pre><code>  &lt;SimpleData name="zip"&gt;60004&lt;/SimpleData&gt;
    &lt;SimpleData name="name"&gt;ARLINGTON HEIGHTS&lt;/SimpleData&gt;
    &lt;SimpleData name="state"&gt;IL&lt;/SimpleData&gt;
    &lt;SimpleData name="countyname"&gt;COOK&lt;/SimpleData&gt;
    &lt;SimpleData name="lat"&gt;42.1121336684356&lt;/SimpleData&gt;
    &lt;SimpleData name="lon"&gt;-87.9736682731814&lt;/SimpleData&gt; 
  </code></pre>
  
  <p>I think my linq2xml lambda is close (after searching MSDN and SO) but I can't seem to tweak it just right:</p>
  
  <pre><code>string cityName = simpleData.Where(a =&gt; a.Attribute("name").Value == "name").Select(a =&gt; a.Value).ToString();
  </code></pre>
  
  <p>The value of cityName get's assigned to "System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String]" instead of ARLINGTON HEIGHTS</p>
  
  <p>Any suggestions? Thanks</p>