title: Deserialization of XDocument doesn't work
body: <p>I have this code:</p>
  
  <pre><code>[Serializable]
      [XmlRoot("ISO_CCY_CODES")]
      public class IsoCurrencyCodes
      {
          public IsoCurrencyCodes()
          {
              IsoCodes = new List&lt;IsoCurrencyCode&gt;();
          }
  
          public IsoCurrencyCodes(List&lt;IsoCurrencyCode&gt; isoCodes)
          {
              IsoCodes = isoCodes;
          }
  
  
          [XmlArrayItem("ISO_CURRENCY")]
          public List&lt;IsoCurrencyCode&gt; IsoCodes { get; set; }
  
          public static IEnumerable&lt;IsoCurrencyCode&gt; Get()
          {
              var doc = XDocument.Parse(XmlStringIsoCodes.XmlSource.Replace("\r\n", ""));
              var res = doc.Deserialize&lt;IsoCurrencyCodes&gt;();
              return res.IsoCodes;
          }
      }
  
      [Serializable]
      [XmlRoot("ISO_CURRENCY")]
      public class IsoCurrencyCode
      {
          public IsoCurrencyCode()
          {
          }
  
          [XmlElement(ElementName = "ENTITY")]
          public string Entity { get; set; }
  
          [XmlElement(ElementName = "CURRENCY")]
          public string Currency { get; set; }
  
          [XmlElement(ElementName = "ALPHABETIC_CODE")]
          public string Alpha_Code3 { get; set; }
  
          [XmlElement(ElementName = "NUMERIC_CODE")]
          public int NumCode { get; set; }
  
          [XmlElement(ElementName = "MINOR_UNIT")]
          public string MinorUnit { get; set; }
      }
  </code></pre>
  
  <p>And this code, for deserialization:</p>
  
  <pre><code>public static XDocument Serialize&lt;T&gt;(this T source)
          {
              var ser = new XmlSerializer(source.GetType());
              var sb = new StringBuilder();
              using (var writer = new StringWriter(sb))
              {
                  ser.Serialize(writer, source);
              }
              return XDocument.Parse(sb.ToString());
          }
  
          public static T Deserialize&lt;T&gt;(this XDocument xmlDocument)
          {
              var xmlSerializer = new XmlSerializer(typeof (T));
              using (var reader = xmlDocument.CreateReader())
                  return (T) xmlSerializer.Deserialize(reader);
          }
  </code></pre>
  
  <p>This is the <a href="http://www.currency-iso.org/dl_iso_table_a1.xml" rel="nofollow">XML source</a></p>
  
  <p>But deserialization doesn't work. Please help.
  Thanks! </p>