title: There is an error in XML document (1, 1)
body: <p>I have been trying to read data from XML. When I try to deserialize it, I get the following error:</p>
  
  <blockquote>
    <p>"There is an error in XML document (1, 1)."</p>
  </blockquote>
  
  <p>For your reference, I am attaching my entire code as well as my xml file.</p>
  
  <p><strong>C# Code:</strong></p>
  
  <pre><code>CarCollection cars = null;
  string path = @"C:\Users\harsha\Desktop\Doc.xml";
  XmlSerializer serializer = new XmlSerializer(typeof(CarCollection));
  var reader = XmlReader.Create(path);
  cars = (CarCollection)serializer.Deserialize(reader);
  reader.Close();
  </code></pre>
  
  <p>Also,the data structure is as follows:</p>
  
  <pre><code>namespace XMLDataReader
  {
     [Serializable()]
     public class Car
     {
         [System.Xml.Serialization.XmlElement("StockNumber")]
         public string StockNumber { get; set; }
  
         [System.Xml.Serialization.XmlElement("Make")]
         public string Make { get; set; }
  
         [System.Xml.Serialization.XmlElement("Model")]
         public string Model { get; set; }
     }
  
     [Serializable()]
     [System.Xml.Serialization.XmlRoot("CarCollection")]
     public class CarCollection
     {
         [XmlArray("Cars")]
         [XmlArrayItem("Car", typeof(Car))]
         public Car[] Car { get; set; }
     }
  </code></pre>
  
  <p><strong>XML File:</strong></p>
  
  <pre><code>   &lt;CarCollection&gt;
  &lt;Cars&gt;
    &lt;Car&gt;
      &lt;StockNumber&gt;1020&lt;/StockNumber&gt;
      &lt;Make&gt;Nissan&lt;/Make&gt;
      &lt;Model&gt;Sentra&lt;/Model&gt;
    &lt;/Car&gt;
    &lt;Car&gt;
      &lt;StockNumber&gt;1010&lt;/StockNumber&gt;
      &lt;Make&gt;Toyota&lt;/Make&gt;
      &lt;Model&gt;Corolla&lt;/Model&gt;
    &lt;/Car&gt;
    &lt;Car&gt;
      &lt;StockNumber&gt;1111&lt;/StockNumber&gt;
      &lt;Make&gt;Honda&lt;/Make&gt;
      &lt;Model&gt;Accord&lt;/Model&gt;
    &lt;/Car&gt;
  &lt;/Cars&gt;
  &lt;/CarCollection&gt;
  </code></pre>
  
  <p>Waiting for some help. Thanks in advance!</p>