title: Using C# abstract class property for Xml serialize
body: <p>I want to create an generic abstract type as base for my xml serialized types:</p>
  
  <pre><code>public abstract class RootElementBase&lt;TEelment&gt;
  {
      public IList&lt;TElement&gt; SubElements {get;set;}
  
      public RootElementBase(){ 
           SubElements = new List&lt;T&gt;(); 
      }
  }
  </code></pre>
  
  <p>And I will use like this:</p>
  
  <pre><code>[XmlRoot(ElementName = "myroot")]
  public class MyRoot: RootElementBase&lt;ItemType&gt; {
       [XmlElement("item")] 
       public override List&lt;ItemType&gt; Elements { get; set; }
  }
  </code></pre>
  
  <p>But this does not serialize MyRoot class. Implemented types use generic abstract class for Elements type. But XmlElelemt attribute tags will be set.</p>