title: How to serialise with custom namespace
body: <p>I am serialising an object to XML and I get the output like so :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;SOrd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  </code></pre>
  
  <p>However I would like it to be like so :</p>
  
  <pre><code>&lt;SOrd xmlns:SOrd="http://..." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://....xsd"&gt;
  </code></pre>
  
  <p><strong>How can I do this?</strong></p>
  
  <p>I have tried adding attributes to the root object before serialisation and also this :</p>
  
  <pre><code>XmlSerializerNamespaces xmlNameSpace = new XmlSerializerNamespaces();
  xmlNameSpace.Add("xmlns:SOrd", "http://...");
  xmlNameSpace.Add("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
  xmlNameSpace.Add("xsi:schemaLocation", "http://....xsd");
  
  XmlSerializer xs = new XmlSerializer(ord.GetType());
  TextWriter writer = new StreamWriter(outputPath, false);
  xs.Serialize(writer, ord, xmlNameSpace);
  writer.Close();
  </code></pre>
  
  <p>But I get the exception <strong>"The ':' character, hexadecimal value 0x3A, cannot be included in a name."</strong></p>