title: Response.Write() vs Response.Outputstream()
body: <p>I'm getting some strange behavoir with my xml-ouput.</p>
  
  <p>I'm filling my xml using a Stringwriter and a xmltextwriter.              </p>
  
  <pre><code>Using textw As New IO.StringWriter
      Using xmlw As New System.Xml.XmlTextWriter(textw)
      ....
      End Using
  </code></pre>
  
  <p>However when outputting the data. i'm getting two different results for the same ('in my eyes') methodoligy. In both situations tw will contain my xml</p>
  
  <p><strong>Non working version: (in IE)</strong></p>
  
  <pre><code>Response.Clear()
  Response.Write(textw.ToString)
  Response.ContentEncoding = System.Text.Encoding.UTF8
  Response.ContentType = "text/xml"
  Response.End()
  </code></pre>
  
  <p>Errormessage is telling there is an error in the contents of my xml.</p>
  
  <p><strong>working version: (in IE)</strong></p>
  
  <pre><code>Response.Clear()
  Dim xmlDoc As New XmlDocument
  xmlDoc.LoadXml(textw.ToString)
  xmlDoc.Save(Response.OutputStream)
  Response.ContentEncoding = System.Text.Encoding.UTF8
  Response.ContentType = "text/xml"
  Response.End()
  </code></pre>
  
  <p><strong>Question:</strong> What is the difference between <code>Response.write</code> and <code>Response.Outputstream</code>?</p>
  
  <p><strong>Note:</strong> Both method appear to be working in firefox &amp; chrome. The xml is valid as its already in use at the moment (using the working version).</p>