C# XML deserialization
<p>I have xml that is returned with an array of different types of objects.  I am having trouble with the xmlchoiceidentifier when it gets to the keyword struct.  When it deserializes it, it just returns null.</p>

<p>Here is the xml that I am trying to deserialize:</p>

<pre><code>&lt;struct&gt;
   &lt;member&gt;
      &lt;name&gt;result&lt;/name&gt;
      &lt;value&gt;&lt;boolean&gt;1&lt;/boolean&gt;&lt;/value&gt;
   &lt;/member&gt;
   &lt;member&gt;
      &lt;name&gt;user_info&lt;/name&gt;
      &lt;value&gt;
         &lt;struct&gt;
            &lt;member&gt;
               &lt;name&gt;First Name&lt;/name&gt;
               &lt;value&gt;&lt;string&gt;John&lt;/string&gt;&lt;/value&gt;
            &lt;/member&gt;
            &lt;member&gt;
               &lt;name&gt;Last Name&lt;/name&gt;
               &lt;value&gt;&lt;string&gt;Smith&lt;/string&gt;&lt;/value&gt;
            &lt;/member&gt;
         &lt;/struct&gt;
      &lt;/value&gt;
   &lt;/member&gt;
&lt;/struct&gt;
</code></pre>

<p>Here is the code I have for deserialization:</p>

<pre><code>public class ResponseStruct
{
    [XmlArray("struct"), XmlArrayItem("member")]
    public List&lt;ResponseMember&gt; Struct { get; set; }
}

public class ResponseArray
{
    [XmlArray("array"), XmlArrayItem("data")]
    public List&lt;ResponseMemberValue&gt; Array { get; set; }
}

public class ResponseMember
{
    [XmlElement("name")]
    public string Name { get; set; }

    [XmlElement("value")]
    public ResponseMemberValue Value { get; set; }
}

public class ResponseMemberValue
{
    [XmlChoiceIdentifier("ValueChoice"), XmlElement("boolean", typeof(bool)), XmlElement("int", typeof(int)), XmlElement("string", typeof(string)), XmlElement("datetime", typeof(DateTime)), XmlElement("double", typeof(double)), XmlElement("base64", typeof(string)), XmlElement("array", typeof(ResponseArray)), XmlElement("struct", typeof(ResponseStruct))]
    public object Value { get; set; }

    [XmlIgnore]
    public virtual ValueType ValueChoice { get; set; }

    public enum ValueType
    {
        @string,
        @int,
        @datetime,
        @double,
        base64,
        array,
        boolean,
        @struct
    }
}
</code></pre>