title: Reading a Facebook feed in C#
body: <p>I want to read an XML stream from a Facebook page. When I try to run the following code, I get the error "An error occurred while parsing EntityName. Line 10, position 53.". Why and how do I solve it?</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          var feed = RssManager.ReadFeed("https://www.facebook.com/feeds/page.php?id=145493382141206&amp;format=rss20");
          foreach (var item in feed)
          {
              Console.WriteLine("***********************************************");
              Console.WriteLine("Title:" + item.title);
              Console.WriteLine("Link:" + item.link);
              Console.WriteLine("Description:" + item.description);
              Console.WriteLine("Language:" + item.language);
              Console.WriteLine("Publish Date:" + item.pubdate);
              Console.WriteLine("***********************************************");
          }
          Console.ReadLine();
      }
  }
  
  public class RssFeedItem
  {
      public string title { get; set; }
      public string link { get; set; }
      public string description { get; set; }
      public string language { get; set; }
      public string pubdate { get; set; }
  }
  
  public static class RssManager
  {
      public static List&lt;RssFeedItem&gt; ReadFeed(string url)
      {
          List&lt;RssFeedItem&gt; rssItems = new List&lt;RssFeedItem&gt;();
          HttpWebRequest rssFeed = (HttpWebRequest)WebRequest.Create(url);
          using (DataSet rssData = new DataSet())
          {
              var response = rssFeed.GetResponse();
              var data = response.GetResponseStream();
              rssData.ReadXml(data);
              foreach (DataRow datarow in rssData.Tables["item"].Rows)
              {
                  rssItems.Add(new RssFeedItem
                  {
                      description = Convert.ToString(datarow["description"]),
                      language = Convert.ToString(datarow["language"]),
                      link = Convert.ToString(datarow["link"]),
                      pubdate = Convert.ToString(datarow["pubdate"]),
                      title = Convert.ToString(datarow["title"])
                  });
              }
          }
          return rssItems;
      }
  }
  </code></pre>