title: Deserializing xml into an ArrayList of objects in C#
body: <p>The following xml is a result of serializing an ArrayList of Asset objets</p>
  
  <pre><code>&lt;ArrayOfAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;Asset&gt;
      &lt;name&gt;bill&lt;/name&gt;
      &lt;type&gt;perosn&lt;/type&gt;
    &lt;/Asset&gt;
    &lt;Asset&gt;
      &lt;name&gt;bill&lt;/name&gt;
      &lt;type&gt;perosn&lt;/type&gt;
    &lt;/Asset&gt;
   &lt;/ArrayOfAsset&gt; 
  </code></pre>
  
  <p>I can deserialize this with the default C# deserializer no problem.  If my root element changes from <strong>ArrayOfAsset</strong> to <strong>assets</strong>, my deserializer blows up.  How can I make my deserializer aware of this change.  </p>
  
  <p>Here is my deserialization code:</p>
  
  <pre><code>  StreamReader sr = new StreamReader("c:\\assest.xml");
    string r = sr.ReadToEnd();
    List&lt;Asset&gt; list;
    Type[] extraTypes = new Type[1];
    extraTypes[0] = typeof(Asset);
    System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(List&lt;Asset&gt;), extraTypes);
    object obj = serializer.Deserialize(xReader);
     list = (List&lt;Asset&gt;)obj;
  </code></pre>