title: How to set xmlns when serializing object in c#
body: <p>I am serializing an object in my ASP.net MVC program to an xml string like this;</p>
  
  <pre><code>StringWriter sw = new StringWriter();
  XmlSerializer s = new XmlSerializer(typeof(mytype));
  s.Serialize(sw, myData);
  </code></pre>
  
  <p>Now this give me this as the first 2 lines;</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  &lt;GetCustomerName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  </code></pre>
  
  <p>my question is, 
  How can I change the xmlns and the encoding type, when serializing?</p>
  
  <p>Thanks</p>