title: Xml Deserialization with Proxy
body: <p>I am having an issue regarding the <strong>deserialization</strong> of an XML class. I need to use a proxy for an IList because XML does not serialize/deserialize on Interfaces. I need to use this proxy because NHibernate does not accept Lists and only accepts interfaces. My issue is only when deserializing. <strong>Serialization works fine.</strong></p>
  
  <pre><code>public class EmailCategory
      {
          [XmlAttribute("Id")]
          public virtual long Id { get; set; }
          [XmlAttribute("Name")]
          public virtual string Name { get; set; }
          protected internal virtual IList&lt;EmailBranch&gt; EmailBranches { get; set; }
  
          [XmlArray("EmailBranches")]
          [XmlArrayItem("EmailBranch", typeof(EmailBranch)]
          public List&lt;EmailBranch&gt; EmailBranchesProxy {
              get { return EmailBranches != null ? EmailBranches .ToList() : null; }
              set { EmailBranches = value; }
          }
      }
  </code></pre>