title: How to serialize xml array AND class properties using C# XML serialization
body: <p>I have a class that is inherited from <code>List&lt;T&gt;</code> and also has some properties, like this:</p>
  
  <pre><code>[Serializable]
  public class DropList : List&lt;DropItem&gt;
  {
      [XmlAttribute]
      public int FinalDropCount{get; set;}
  }
  </code></pre>
  
  <p>This class is serialized to xml as part of a larger class:</p>
  
  <pre><code>[Serializable]
  public class Location
  {
      public DropList DropList{get; set;}
      ....
  }
  </code></pre>
  
  <p>The problem is, serializer sees my list as a collection; the resulting XML contians only list elements, but not class properties (FinalDropCount in this case). This is an example of outputted XML:</p>
  
  <pre><code>&lt;Location xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
      &lt;DropList&gt;
          &lt;DropItem ProtoId="3" Count="0" Minimum="0" Maximum="0" /&gt;
          &lt;DropItem ProtoId="4" Count="0" Minimum="0" Maximum="0" /&gt;
      &lt;/DropList&gt;
      ....
  &lt;/Location&gt;
  </code></pre>
  
  <p>Is there some way to save <em>both</em> list contents and properties without resorting to implementing <code>IXmlSerializable</code> by hand?</p>