title: Error "Data at the root level is invalid" after transformation, while doing a LoadXML
body: <p>I am trying to do some XSLT transformation, to convert an XML to XML, using the following lines of code. When i try to create an XMLDocument object from the transformed XML i am getting an error</p>
  
  <p>Data at the root level is invalid. Line 1, position 1.</p>
  
  <pre><code> Dim outputXML As New XmlDocument
  
          Dim stream As New MemoryStream
          Dim writer As XmlTextWriter = New XmlTextWriter(stream, System.Text.UnicodeEncoding.UTF8)
  
          Dim navigator As XPathNavigator = illustratePlusXML.CreateNavigator()
          Dim transormer As XslCompiledTransform = New XslCompiledTransform()
          transormer.Load(ConfigurationManager.AppSettings("XSLT_File_Path"))
          transormer.Transform(navigator, Nothing, writer)
  
          Dim output As String = System.Text.UnicodeEncoding.UTF8.GetString(stream.ToArray())
          outputXML.LoadXml(output)
  
          Return outputXML
  </code></pre>
  
  <p>I could find a special character(square box), i persume this is causing the error. attached snapshot of the output xml. Can somebody please suggest ?</p>
  
  <p><img src="https://i.stack.imgur.com/Yk3dZ.jpg" alt="output xml with special character"></p>