title: How to deserialize a given xml document
body: <p>Help figure out why my method Deserialize from the class XML return null, why?
  Document format attached........................................................
  ................................................................................
  ................................................................................                                                      </p>
  
  <p><a href="https://i.stack.imgur.com/rkLpj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rkLpj.png" alt="enter image description here"></a></p>
  
  <pre><code>public class XMl
  {
      //список данных из xml
  
      public XMl() { }
  
      public dataroot Deserialize(String pathToFile)
      {
          //dataroot dataRoot = null;
  
          //var serializer = new XmlSerializer(typeof(dataroot));
  
          //var reader = new StreamReader(pathToFile);
          //dataRoot = (dataroot)serializer.Deserialize(reader);
          //reader.Close();
  
          //return dataRoot;
  
          XmlSerializer ser = new XmlSerializer(typeof(dataroot));
          dataroot dataRoot = null;
          using (XmlReader reader = XmlReader.Create(pathToFile))
          {
              dataRoot = (dataroot)ser.Deserialize(reader);
          }
  
          return dataRoot;
      }
  }
  
  
  [Serializable()]
  public class XML_Vozdykhoobmen
  {
      [XmlElement("ID_Zdan")]
      public String ID_Zdan { get; set; }
  
      [XmlElement("ID_Pom")]
      public String ID_Pom { get; set; }
  
      [XmlElement("NaimZdaniya")]
      public String NaimZdaniya { get; set; }
  
      [XmlElement("NaimPomeshcheniya")]
      public String NaimPomeshcheniya { get; set; }
  
      [XmlElement("KlimatPoyas")]
      public String KlimatPoyas { get; set; }
  
      [XmlElement("Temperatyra")]
      public String Temperatyra { get; set; }
  
      [XmlElement("PritokKratnost")]
      public String PritokKratnost { get; set; }
  
      [XmlElement("PritokEdinitsaIzm")]
      public String PritokEdinitsaIzm { get; set; }
  
      [XmlElement("VytyazhkaKratnost")]
      public String VytyazhkaKratnost { get; set; }
  
      [XmlElement("VytyazhkaEdinitsaIzm")]
      public String VytyazhkaEdinitsaIzm { get; set; }
  
      [XmlElement("EdinitsaIzm")]
      public String EdinitsaIzm { get; set; }
  
      [XmlElement("PoRaschety")]
      public String PoRaschety { get; set; }
  
      [XmlElement("Kolichestvo")]
      public String Kolichestvo { get; set; }
  
      [XmlElement("Prim")]
      public String Prim { get; set; }
  }
  
  [Serializable()]
  [XmlRoot("dataroot")]
  public class dataroot
  {
      //[XmlArray("Vozdykhoobmens")]
      [XmlArrayItem("XML_Vozdykhoobmen", typeof(XML_Vozdykhoobmen))]
      public XML_Vozdykhoobmen[] Vozdykhoobmen { get; set; }
  }
  </code></pre>