title: XML Deserialization with special characters in C# XMlSerializer
body: <p>I have an xml sheet which contains some special character <strong><em>"&amp; is the special character causing issues"</em></strong> and i use below code to deserialize XML</p>
  
  <pre><code>           XMLDATAMODEL imported_data;
  
              // Create an instance of the XmlSerializer specifying type and namespace.
              XmlSerializer serializer = new XmlSerializer(typeof(XMLDATAMODEL));
  
              // A FileStream is needed to read the XML document.
              FileStream fs = new FileStream(path, FileMode.Open);
              XmlReader reader = XmlReader.Create(fs);
  
  
              // Use the Deserialize method to restore the object's state.
              imported_data = (XMLDATAMODEL)serializer.Deserialize(reader);
              fs.Close();
  </code></pre>
  
  <p>and structre of my XML MOdel is like this </p>
  
  <pre><code>    [XmlRoot(ElementName = "XMLDATAMODEL")]
      public class XMLDATAMODEL
      {
          [XmlElement(ElementName = "EventName")]
          public string EventName { get; set; }
          [XmlElement(ElementName = "Location")]
          public string Location { get; set; }
      }
  </code></pre>
  
  <p>I tried this code as well with Encoding mentioned but no success</p>
  
  <pre><code>            // Declare an object variable of the type to be deserialized.
  
              StreamReader streamReader = new StreamReader(path, System.Text.Encoding.UTF8, true);
              XmlSerializer serializer = new XmlSerializer(typeof(XMLDATAMODEL));
              imported_data = (XMLDATAMODEL)serializer.Deserialize(streamReader);
              streamReader.Close();
  </code></pre>
  
  <p>Both approaches failed and if i put special character inside Cdata it looks working.
  How can i make it work for xml data without CData as well? </p>
  
  <p>Here is my XML file content </p>
  
  <p><a href="http://pastebin.com/Cy7icrgS" rel="nofollow">http://pastebin.com/Cy7icrgS</a></p>
  
  <p>And error i am getting is There is an error in XML document (2, 17).</p>