title: Decoding from Base64 in C#
body: <p>I created XML Document  and saved this document as</p>
  
  <pre><code>  XmlDocument xmlDoc = new XmlDocument();
    XmlDeclaration dec = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null);
    xmlDoc.AppendChild(dec);
    XmlTextWriter writer = new XmlTextWriter(fullPath,Encoding.UTF8);
    writer.Formatting = Formatting.Indented;
    xMLDoc.Save(writer);
    writer.Flush();
  </code></pre>
  
  <p>And then I have encoded this document using Base64 Encoder</p>
  
  <p>The Decoder could not parse XML file.
  I created the decoder myself and got this result</p>
  
  <pre><code> ?&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;ClinicalDocument 
   xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
  classCode=\"DOCCLIN\" moodCode=\"EVN\" schemaLocation=\"urn:hl7-org:v3
  CDA.xsd\"&gt;\r\n  &lt;typeId extension=\"POCD_HD000040\" root=\"2.16.840.1.113883.1.3
  \" /&gt;\r\n
  </code></pre>
  
  <p>Please help me to resolve the issue.
  How I have to save the XML file to avoid the issues?
  Or How I have to encode to Base 64 to resolve the issue?
  I am using base64 encoder to encode xml file.
  I am requesting document. it is required to use base64 encoder.
  I decoded myself to check where is the problem. 
  The decoder is Java . They can not parse the xml file I believe because ?&lt; in front of the document.</p>