title: How do I add a namespace when creating an XML file?
body: <p>I have to create an XML document in C#.</p>
  
  <p>The root element has to look like this: </p>
  
  <pre><code>&lt;valuation-request 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:noNamespaceSchemaLocation="valuations.xsd"&gt;
  </code></pre>
  
  <p>I'm using the following</p>
  
  <pre><code>XmlElement root = X.CreateElement("valuation-request");
  root.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
  root.SetAttribute("xsi:noNamespaceSchemaLocation", "valuations.xsd");
  </code></pre>
  
  <p>However this produces</p>
  
  <pre><code>&lt;valuation-request 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       noNamespaceSchemaLocation="valuations.xsd"&gt; //missing the xsi:
  </code></pre>
  
  <p>What am I missing?</p>