title: Deserialization with XmlSerializer
body: <p>I'm writing a Windows Store App and I need to store some data in Roaming Storage; for that I needed to serialize/deserialize some data. My serializer/deserializer functions are as below:</p>
  
  <pre><code>public string Serialize()
      {
          try
          {
              StringWriter sw = new StringWriter();
  
              XmlSerializer xs = new XmlSerializer(typeof(RssData));
              xs.Serialize(sw, this);
  
  
              return sw.ToString();
          }
          catch (Exception ex)
          {
              System.Diagnostics.Debug.WriteLine(ex);
              return String.Empty;
          }
      }
  
      public void Deserialize(string serialized)
      {
          try
          {
              XmlSerializer xs = new XmlSerializer(typeof(RssData));
              XmlReader xr = XmlReader.Create(new StringReader(serialized));
              RssData rd = xs.Deserialize(xr) as RssData;
              this.categoryList = rd.categoryList;
              this.defaultCategory = rd.defaultCategory;
          }
          catch(Exception ex)
          {
              System.Diagnostics.Debug.WriteLine(ex);
          }
      }
  </code></pre>
  
  <p>In summary, RssData has a list of RssCategory, and each RssCategory has a RssFeed. There is no problem with serialization and the following string is an example that I've produced using the Serialize function above:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  &lt;RssData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;CategoryList&gt;
      &lt;RssCategory&gt;
        &lt;Name&gt;No Category&lt;/Name&gt;
        &lt;RssList&gt;
          &lt;RssFeed&gt;
            &lt;Title&gt;HABERTURK.COM&lt;/Title&gt;
            &lt;Url&gt;http://www.haberturk.com/rss&lt;/Url&gt;
            &lt;Image&gt;http://www.haberturk.com/images/htklogo2.jpg&lt;/Image&gt;
            &lt;Subtitle&gt;HABERTÜRK - Türkiye'nin En Büyük İnternet Gazetesi&lt;/Subtitle&gt;
          &lt;/RssFeed&gt;
        &lt;/RssList&gt;
      &lt;/RssCategory&gt;
    &lt;/CategoryList&gt;
  &lt;/RssData&gt;
  </code></pre>
  
  <p>However, when I Deserialize this XML, the resulting RssData has a CategoryList with 2 RssCategories, one is a RssCategory named "No Category" with an empty RssList, the other one is the correct one as defined in the XML; i.e. "No Category" with one RssFeed. </p>
  
  <p>Is it a problem with my code or is XmlSerializer bugged?</p>