title: XML Deserialize array in C#
body: <p>I have tried everything cant deserialize this XML document.</p>
  
  <pre><code>&lt;items&gt;
      &lt;item&gt;
          &lt;id&gt;00175565&lt;/id&gt;
          &lt;descr&gt;KJAAM-EMC 16x(2+1)x0,5 T500&lt;/descr&gt;
          &lt;unit&gt;st&lt;/unit&gt;
          &lt;vat&gt;25&lt;/vat&gt;
          &lt;inprice&gt;374&lt;/inprice&gt;
          &lt;isstock&gt;0&lt;/isstock&gt;
          &lt;stock&gt;0&lt;/stock&gt;
          &lt;paccount/&gt;
          &lt;ean&gt;00175565&lt;/ean&gt;
          &lt;type&gt;1&lt;/type&gt;
          &lt;producer/&gt;
          &lt;producer_itemno&gt;00175565&lt;/producer_itemno&gt;
          &lt;package_height/&gt;
          &lt;package_depth/&gt;
          &lt;package_width/&gt;
          &lt;package_weight/&gt;
          &lt;stock_place/&gt;
          &lt;stock_warning/&gt;
          &lt;note/&gt;
          &lt;bulky&gt;0&lt;/bulky&gt;
          &lt;omit&gt;0&lt;/omit&gt;
          &lt;available&gt;0&lt;/available&gt;
          &lt;account&gt;3041&lt;/account&gt;
          &lt;constracct&gt;3231&lt;/constracct&gt;
          &lt;exportacct&gt;3315&lt;/exportacct&gt;
          &lt;eurevacct&gt;3318&lt;/eurevacct&gt;
          &lt;euvatacct&gt;3316&lt;/euvatacct&gt;
          &lt;supplierno/&gt;
          &lt;show_in_webshop&gt;0&lt;/show_in_webshop&gt;
          &lt;price&gt;
                &lt;list-a&gt;
                      &lt;from-0&gt;486.2&lt;/from-0&gt;
                &lt;/list-a&gt;
          &lt;/price&gt;
      &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>This is how i deserialize it</p>
  
  <pre><code>[Serializable()]
  public class item
  {
      [System.Xml.Serialization.XmlElement("id")]
      public string ID { get; set; }
  
      [System.Xml.Serialization.XmlElement("descr")]
      public string Descr { get; set; }
  
      [System.Xml.Serialization.XmlElement("unit")]
      public string Unit { get; set; }
  
      [System.Xml.Serialization.XmlElement("vat")]
      public string Vat { get; set; }
  
      [System.Xml.Serialization.XmlElement("inprice")]
      public string Inprice { get; set; }
  
      [System.Xml.Serialization.XmlElement("isstock")]
      public string Isstock { get; set; }
  
      [System.Xml.Serialization.XmlElement("stock")]
      public string Stock { get; set; }
  
      [System.Xml.Serialization.XmlElement("paccount")]
      public string Paccount { get; set; }
  
      [System.Xml.Serialization.XmlElement("ean")]
      public string Ean { get; set; }
  
      [System.Xml.Serialization.XmlElement("type")]
      public string Type { get; set; }
  
      [System.Xml.Serialization.XmlElement("producer")]
      public string Producer { get; set; }
  
      [System.Xml.Serialization.XmlElement("producer_itemno")]
      public string Producer_itemno { get; set; }
  
      [System.Xml.Serialization.XmlElement("package_height")]
      public string Package_height { get; set; }
  
      [System.Xml.Serialization.XmlElement("package_depth")]
      public string Package_depth { get; set; }
  
      [System.Xml.Serialization.XmlElement("package_width")]
      public string Package_width { get; set; }
  
      [System.Xml.Serialization.XmlElement("package_weight")]
      public string Package_weight { get; set; }
  
      [System.Xml.Serialization.XmlElement("stock_place")]
      public string Stock_place { get; set; }
  
      [System.Xml.Serialization.XmlElement("stock_warning")]
      public string Stock_warning { get; set; }
  
      [System.Xml.Serialization.XmlElement("note")]
      public string Note { get; set; }
  
      [System.Xml.Serialization.XmlElement("bulky")]
      public string Bulky { get; set; }
  
      [System.Xml.Serialization.XmlElement("omit")]
      public string Omit { get; set; }
  
      [System.Xml.Serialization.XmlElement("available")]
      public string Available { get; set; }
  
      [System.Xml.Serialization.XmlElement("account")]
      public string Account { get; set; }
  
      [System.Xml.Serialization.XmlElement("constracct")]
      public string Constracct { get; set; }
  
      [System.Xml.Serialization.XmlElement("exportacct")]
      public string Exportacct { get; set; }
  
      [System.Xml.Serialization.XmlElement("eurevacct")]
      public string Eurevacct { get; set; }
  
      [System.Xml.Serialization.XmlElement("euvatacct")]
      public string Euvatacct { get; set; }
  
      [System.Xml.Serialization.XmlElement("supplierno")]
      public string Supplierno { get; set; }
  
      [System.Xml.Serialization.XmlElement("show_in_webshop")]
      public string Show_in_webshop { get; set; }
  
      [XmlArray("price")]
      [XmlArrayItem("list-a")]
      public List&lt;string&gt; price { get; set; }
  }
  
  
  [XmlRoot("items")]
  public class items
  {
      [XmlElement("item")]
      public item[] item { get; set; }
  }
  </code></pre>
  
  <p>The problem is that i get one row of the first set of item. but when i remove </p>
  
  <pre><code>    [XmlArray("price")]
      [XmlArrayItem("list-a")]
      public List&lt;string&gt; price { get; set; }
  </code></pre>
  
  <p>it gives me all the rows. I have tried alot of things and look on some other posted questions equal to this but i cant get it to work.</p>
  
  <p>the only way for me to get something at all from  is to use the code above.</p>
  
  <p>I greatly appreciate all the help i can get!</p>