title: atom namespace using linq
body: <p>I have the following xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"&gt;
  &lt;entry&gt;&lt;id&gt;&lt;![CDATA[text]]&gt;&lt;/id&gt;&lt;
  author&gt;&lt;name&gt;&lt;![CDATA[film24]]&gt;&lt;/name&gt;&lt;/author&gt;&lt;title&gt;&lt;![CDATA[text]]&gt;&lt;/title&gt;
  &lt;updated&gt;2009-10-30T15:55:13+00:00&lt;/updated&gt;&lt;published&gt;2009-10-30T00:00:00+00:00&lt;/published&gt;
  &lt;media:thumbnail type="image/jpeg" title="thumbnail" url=""/&gt;
  &lt;media:content type="video/flv" title="video" url="" expression="high"/&gt;
  &lt;media:content type="video/flv" title="video" url="" expression="low"/&gt;
  &lt;/entry&gt;
  &lt;/feed&gt;
  </code></pre>
  
  <p>If i include the following namespace i cannot query the xml. ie it doesn't return any results. </p>
  
  <p><a href="http://www.w3.org/2005/Atom" rel="nofollow noreferrer">http://www.w3.org/2005/Atom</a></p>
  
  <p>Here is how i query the xml</p>
  
  <pre><code>        XNamespace nsMedia = "http://search.yahoo.com/mrss/";
          XNamespace nsAtom = "http://www.w3.org/2005/Atom";
  
          string url = HttpContext.Current.Server.MapPath(ConfigHelper.GetValue("FeedUri"));
          var feed = XElement.Load(url);
          var posts = from c in feed.Descendants(nsAtom + "entry")
                      select new CDNEntry
                      {
                           Id = (string)c.Element(nsAtom + "id").Value,
                           Author = (string)c.Element(nsAtom + "author").Value,
                           Title = (c.Element("title") != null) ? (string)c.Element(nsAtom + "title").Value : "",
                           Summary = (c.Element("summary") != null) ? (string)c.Element(nsAtom + "summary").Value : "",
                           Thumbnail = (string)c.Element(nsMedia + "thumbnail").Attribute(nsAtom + "url").Value,
                           FLV = (string)c.Element(nsMedia + "content").Attribute(nsAtom + "url").Value,
                           Updated = DateTime.Parse((string)c.Element(nsAtom + "updated").Value),
                           Published = DateTime.Parse((string)c.Element(nsAtom + "published").Value)
                      };
  
          return posts.ToList();
  </code></pre>