title: Find an XElement with a certain attribute name and value with LINQ
body: <pre><code>XDocument xDocument = XDocument.Load("...");
  IEnumerable&lt;XElement&gt; elements = xDocument
      .Element("lfm")
      .Element("events")
      .Elements("event");
  
  try
  {            
      foreach (XElement elm in elements)
      {
          comm.Parameters.AddWithValue("extID", elm.Element("id").Value  ?? "");
          comm.Parameters.AddWithValue("Title", elm.Element("title").Value ?? "");
          comm.Parameters.AddWithValue("HeadlineArtist", 
          elm.Element("artists").Element("headliner").Value ?? "");
  </code></pre>
  
  <p>but I want the value of the element "image" with the attribute "size=large", I have been looking all night, and this is the closest I have come:</p>
  
  <pre><code>comm.Parameters.AddWithValue("LargeImage",
      elm.Descendants("image")
         .FirstOrDefault(i =&gt; (string)i.Attribute("size") == "large").Value);
  </code></pre>
  
  <p>Sample of the part of XML response:</p>
  
  <pre><code>&lt;lfm status="ok"&gt;
      &lt;events xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
              location="Chicago, United States" page="1" perPage="1"
              totalPages="341" total="341" festivalsonly="0" tag=""&gt;
          &lt;event xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"&gt;
              &lt;id&gt;3264699&lt;/id&gt;
              &lt;title&gt;Iron And Wine&lt;/title&gt;
              &lt;artists&gt;
                  &lt;artist&gt;Iron And Wine&lt;/artist&gt;
                  &lt;artist&gt;Dr. John&lt;/artist&gt;
                  &lt;headliner&gt;Iron And Wine&lt;/headliner&gt;
              &lt;/artists&gt;
              &lt;venue&gt;
                  &lt;id&gt;8915382&lt;/id&gt;
                  &lt;name&gt;Ravinia Festival&lt;/name&gt;
                  &lt;location&gt;
                      &lt;city&gt;Highland Park&lt;/city&gt;
                      &lt;country&gt;United States&lt;/country&gt;
                      &lt;street&gt;200 Ravinia Park Rd&lt;/street&gt;
                      &lt;postalcode&gt;60035&lt;/postalcode&gt;
                      &lt;geo:point&gt;
                          &lt;geo:lat&gt;42.15831&lt;/geo:lat&gt;
                          &lt;geo:long&gt;-87.778409&lt;/geo:long&gt;
                      &lt;/geo:point&gt;
                  &lt;/location&gt;
                  &lt;url&gt;http://www.last.fm/venue/8915382+Ravinia+Festival&lt;/url&gt;
                  &lt;website&gt;http://www.ravinia.org/&lt;/website&gt;
                  &lt;phonenumber&gt;847.266.5100&lt;/phonenumber&gt;
                  &lt;image size="small"&gt;http://userserve-ak.last.fm/serve/34/63026487.jpg&lt;/image&gt;
                  &lt;image size="medium"&gt;http://userserve-ak.last.fm/serve/64/63026487.jpg&lt;/image&gt;
                  &lt;image size="large"&gt;http://userserve-ak.last.fm/serve/126/63026487.jpg&lt;/image&gt;
                  &lt;image size="extralarge"&gt;http://userserve-ak.last.fm/serve/252/63026487.jpg&lt;/image&gt;
  </code></pre>