title: Parsing an Atom feed via LINQ to XML
body: <p>I wrote a code snippet to extract elementary information from an Atom feed (e.g. a SO feed) using a LINQ to XML query.</p>
  
  <p>I'd like to know if there are be cases when this code could fail or if there are more elegant ways. </p>
  
  <p>Thanks for the support.</p>
  
  <pre><code>var url = @"http://stackoverflow.com/feeds";
  XDocument rss = XDocument.Load(url);
  
  var q = from i in rss.Root.Elements("{http://www.w3.org/2005/Atom}entry")
  select new {
          Title = i.Element("{http://www.w3.org/2005/Atom}title").Value, 
          URL = i.Element("{http://www.w3.org/2005/Atom}link").Attribute("href").Value};
  </code></pre>