Deserialize XML to object C#
<p>I'm trying to serialize xml to object, but after serializing my list of transport-agreements is empty. I pretty sure this is quite easy, but i cant find my error.</p>

<p>I have the following xml</p>

<pre><code>&lt;transport-agreements type="array"&gt;
   &lt;transport-agreement&gt;
     &lt;id type="integer"&gt;1047&lt;/id&gt;
     &lt;description&gt;Standard&lt;/description&gt;
     &lt;products type="array"&gt;
       &lt;product&gt;not important&lt;/product&gt;
     &lt;/products&gt;
   &lt;/transport-agreement&gt;
   &lt;transport-agreement&gt;
     &lt;id type="integer"&gt;1048&lt;/id&gt;
     &lt;description&gt;Standard&lt;/description&gt;
     &lt;products type="array"&gt;
       &lt;product&gt;not important&lt;/product&gt;
    &lt;/products&gt;
   &lt;/transport-agreement&gt;
&lt;/transport-agreements&gt;
</code></pre>

<p>And i have the following code:</p>

<pre><code>var resultContent = await response.Content.ReadAsStreamAsync();
var serializer = new XmlSerializer(typeof(TransportAgreementRoot));
var transportAgreements = (TransportAgreementRoot)serializer.Deserialize(resultContent);
</code></pre>

<p>And my classes:</p>

<pre><code>[Serializable, XmlRoot("transport-agreements")]

    public class TransportAgreementRoot
    {
        [XmlArrayItem("transport-agreement")]
        TransportAgreement[] TransportAgreements { get; set; }         
     }

    public class TransportAgreement
    {
        [XmlElement("description")]
        public string Description { get; set; }
        [XmlElement("id")]
        public int Id { get; set; }
        [XmlElement("number")]
        public string Number { get; set; }
        [XmlElement("carrier")]
        public Carrier Carrier { get; set; }
        [XmlArray("products")]
        [XmlArrayItem("product")]
        public Product[] Products { get; set; }

    }
</code></pre>