title: Skipping element when deserializing an XML to list of objects
body: <p>I have the following XML:</p>
  
  <pre><code>&lt;OUTPUT_XML&gt;
          &lt;VehicleMakes&gt;
              &lt;VehicleMake VehMakeId="1" MakeName="VOLKSWAGEN" VehTypeId="1"/&gt;
              &lt;VehicleMake VehMakeId="2" MakeName="OPEL" VehTypeId="1"/&gt;
              &lt;VehicleMake VehMakeId="3" MakeName="FORD" VehTypeId="1"/&gt;
              &lt;VehicleMake VehMakeId="4" MakeName="VAZ" VehTypeId="1"/&gt;
              &lt;VehicleMake VehMakeId="5" MakeName="FIAT" VehTypeId="1"/&gt;
          &lt;/VehicleMakes&gt;
  &lt;/OUTPUT_XML&gt;
  </code></pre>
  
  <p>and I need to serialize it to an object, but i need to skip <code>&lt;OUTPUT_XML&gt;</code> and deserialize only VehicleMakes. as List. I used XmlArray and XmlArrayItem in a class that represents OUTPUT_XML and that worked, but If I try to skip that class (OUTPUT_XML) by writing:</p>
  
  <pre><code> public class GetMakesResponse
          {
              [XmlElement("exec_id")]
              public string ExecId { get; set; }
  
              [XmlElement("ERROR_CODE")]
              public int ErrorCode { get; set; }
  
              [XmlElement("VehicleMake")]
              public List&lt;VehicleMake&gt; VehicleMakes { get; set; }
          }
  </code></pre>
  
  <p>the xml serializer fails and the collection is empty.</p>
  
  <p>Thanks.</p>
  
  <p>ADD:</p>
  
  <p>Currently I use the following classes:</p>
  
  <pre><code> [Serializable]
          [XmlRoot("root")]
          public class MakesResponse
          {
              [XmlElement("exec_id")]
              public string ExecId { get; set; }
  
              [XmlElement("ERROR_CODE")]
              public int ErrorCode { get; set; }
  
              [XmlElement("OUTPUT_XML")]
              public Output Output { get; set; }
          }
  
  [Serializable]
      public class VehicleMake
      {
          [XmlAttribute("VehMakeId")]
          public int VehMakeId { get; set; }
  
          [XmlAttribute("MakeName")]
          public string MakeName { get; set; }
  
          [XmlAttribute("VehTypeId")]
          public short VehTypeId { get; set; }
      }
  
  [Serializable]
      public class Output
      {
          [XmlArray(ElementName = "VehicleMakes")]
          [XmlArrayItem(ElementName = "VehicleMake")]
          public List&lt;VehicleMake&gt; VehicleMakes { get; set; }
      }
  </code></pre>
  
  <p>And the code to deserialize:</p>
  
  <pre><code>public class XmlSerializationUtility&lt;T&gt;
      {
          private readonly XmlSerializer _serializer;
  
          public XmlSerializationUtility()
          {
              _serializer = new XmlSerializer(typeof(T));
          } 
  
          public T Deserialize(string xml)
          {
              using (var mStream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
              {
                  return (T)_serializer.Deserialize(mStream);
              }
          }
  
          public string Serialize&lt;TInput&gt;(TInput obj)
          {
              using (var sw = new StringWriter())
              using (var writer = XmlWriter.Create(sw))
              {
                  _serializer.Serialize(writer, obj);
                  return sw.ToString();
              }
          }
      }
  </code></pre>
  
  <p>And this works fine but i want to skip Output id possible.</p>