title: Setting StandAlone = Yes in .Net when serializing an object
body: <p>In the following code I want to set "standalone = yes" to the xml, how can I do this?</p>
  
  <pre><code>Dim settings As New Xml.XmlWriterSettings
  settings.Encoding = encoding
  
  Using stream As New IO.MemoryStream, xtWriter As Xml.XmlWriter = _
      Xml.XmlWriter.Create(stream, settings)
      serializer.Serialize(xtWriter, obj)
      Return encoding.GetString(stream.ToArray())
  End Using
  </code></pre>
  
  <p>For example, I have this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p>But I want this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
  </code></pre>