title: Deserialization of a property typed as object results XmlNode array
body: <p>i have the following XML file to deserialize:</p>
  
  <pre><code>&lt;RoutesConfiguration&gt;
      &lt;RouteList&gt;
          &lt;SpecialRoute Name="Url" Urlpattern="MyUrl"&gt;
              &lt;Defaults&gt;
                  &lt;Item&gt;
                      &lt;Key&gt;controller&lt;/Key&gt;
                      &lt;Value&gt;Rss&lt;/Value&gt;
                  &lt;/Item&gt;
                  &lt;Item&gt;
                      &lt;Key&gt;action&lt;/Key&gt;
                      &lt;Value&gt;LastItems&lt;/Value&gt;
                  &lt;/Item&gt;
                   &lt;Item&gt;
                      &lt;Key&gt;id&lt;/Key&gt;
                      &lt;Value&gt;1&lt;/Value&gt;
                  &lt;/Item&gt;
              &lt;/Defaults&gt;
          &lt;/SpecialRoute&gt;
      &lt;/RouteList&gt;
  &lt;/RoutesConfiguration&gt;
  </code></pre>
  
  <p>This is my deserialization code: </p>
  
  <pre><code>StreamReader reader = new StreamReader(Server.MapPath(ConfigurationManager.AppSettings["RoutesConfigurationPath"]));
   var routes = (RoutesConfiguration)serializer.Deserialize(reader);
  </code></pre>
  
  <p>This class represents <strong>every "Item"</strong> Element in my XML file.</p>
  
  <pre><code>public class Item
  {
          public string Key { get; set; }
          public object Value { get; set; }
  }
  </code></pre>
  
  <p>Im getting my deserialized instance okay, but with one issue on the property "Value" of every Item.</p>
  
  <p>This "value" propery is being deserialized as <strong>System.Xml.XmlNode[]</strong>. The thing is that i cannot type this property to string, or int since this value can be set to both types. For this reason i typed as "Object".</p>
  
  <p>Do you know any way to get from deserialization the right type and not this XmlNode array?</p>
  
  <p>Thanks</p>
  
  <p>Regards.</p>
  
  <p>Jose </p>