title: SQL Server insert XML node is adding namespace
body: <p>I have an existing XML column that I'd like to append a node to, but the node is being added with an unwanted namespace.</p>
  
  <pre><code>DECLARE @x XML =
  '&lt;Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="abc"&gt;
    &lt;Setting key="display" display="ABC" group="service" enabled="true"&gt;
      &lt;Value xsi:type="xsd:string"&gt;ABC&lt;/Value&gt;
    &lt;/Setting&gt;
  &lt;/Test&gt;'
  
  CREATE TABLE #C ( x XML )
  
  INSERT INTO #C
  SELECT @X
  
  declare @name varchar(50) = 'ABC'
  UPDATE #C
  SET X.modify('insert &lt;Setting key="about" display="About" group="service" enabled="true"&gt;
             &lt;Value xsi:type="xsd:string"&gt;string of text about {sql:variable("@name")} here.&lt;/Value&gt;
           &lt;/Setting&gt; as last into (/Test[1])')
  
  select * from #C
  </code></pre>
  
  <p>results in the new setting being added as...</p>
  
  <pre><code>&lt;Setting key="about" display="About" group="service" enabled="true"&gt;
      &lt;Value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"&gt;string of text about ABC here.&lt;/Value&gt;
  &lt;/Setting&gt;
  </code></pre>
  
  <p>but what I really want is</p>
  
  <pre><code>    &lt;Setting key="about" display="About" group="service" enabled="true"&gt;
          &lt;Value xsi:type="xsd:string"&gt;string of text about ABC here.&lt;/Value&gt;
      &lt;/Setting&gt;
  </code></pre>