title: How to make TXMLDocument (with the MSXML Implementation) always include the encoding attribute?
body: <p>I have legacy code (I didn't write it) that always included the encoding attribute, but recompiling it to D2010, TXMLDocument doesn't include the encoding anymore. Because the XML data have accented characters both on tags and data, TXMLDocument.LoadFromFile simply throws EDOMParseErros saying that an invalid character is found on the file. Relevant code:</p>
  
  <pre><code>   Doc := TXMLDocument.Create(nil);  
     try
       Doc.Active := True;
       Doc.Encoding := XMLEncoding;
       RootNode := Doc.CreateElement('Test', '');
       Doc.DocumentElement := RootNode;
       &lt;snip&gt;
       //Result := Doc.XMl.Text;
       Doc.SaveToXML(Result);    // Both lines gives the same result
  </code></pre>
  
  <p>On older versions of Delphi, the following line is generated:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  </code></pre>
  
  <p>On D2010, this is generated:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  </code></pre>
  
  <p>If I change manually the line, all works like always worked in the last years.</p>
  
  <p>UPDATE: XMLEncoding is a constant and is defined as follow</p>
  
  <pre><code>  XMLEncoding = 'ISO-8859-1';
  </code></pre>