title: Adding a reference to an xml schema to XML Serialized Output
body: <p>When serializing object with the code:</p>
  
  <pre><code>var xmlSerializer = new XmlSerializer(typeof(MyType));
  using (var xmlWriter = new StreamWriter(outputFileName))
  {
      xmlSerializer.Serialize(xmlWriter, myTypeInstance);
  }
  </code></pre>
  
  <p>In the output xml file I get:</p>
  
  <pre><code>&lt;MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  </code></pre>
  
  <p>How do I add a reference to xml schema to it, so it looks like this:</p>
  
  <pre><code>&lt;MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
          xsi:noNamespaceSchemaLocation="mySchema.xsd"&gt;
  </code></pre>