title: format the xml output
body: <p>I am using this method to transform an object to XML:</p>
  
  <pre><code>protected XmlDocument SerializeAnObject(object obj)
  {
      XmlDocument doc = new XmlDocument();
      DataContractSerializer serializer = new DataContractSerializer(obj.GetType());
      MemoryStream stream = new MemoryStream();
      try
      {
          serializer.WriteObject(stream, obj);
          stream.Position = 0;
          doc.Load(stream);
          return doc;
      }
      finally
      {
          stream.Close();
          stream.Dispose();
      }
  }
  </code></pre>
  
  <p>Eventually I get something like:</p>
  
  <pre><code>&lt;CaCT&gt;
    &lt;CTC i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/a.b.BusinessEntities.InnerEntities" /&gt; 
    &lt;CTDescr xmlns="http://schemas.datacontract.org/2004/07/a.b.BusinessEntities.InnerEntities"&gt;blabla&lt;/CTDescr&gt; 
    &lt;CaId&gt;464&lt;/CaId&gt; 
    &lt;/CaCT&gt;
  </code></pre>
  
  <p>How can I get rid of the <code>i:nil="true"</code> and the <code>xmlns="http://schemas.datacontract.org/2004/07/a.b.BusinessEntities.InnerEntities"</code>?</p>