title: Inserting an attribute in multiple XML Nodes using XML.modify() in SQL 2005
body: <p>I have an @XML document created from a single select statement. </p>
  
  <pre><code>&lt;root&gt;
   &lt;node&gt;
    &lt;node1&gt;
     &lt;targetNode&gt;
     &lt;/targetNode&gt;
    &lt;/node1&gt;
    &lt;node1&gt;
     &lt;targetNode&gt;
     &lt;/targetNode&gt;
    &lt;/node1&gt;
    &lt;node1&gt;
     &lt;targetNode&gt;
     &lt;/targetNode&gt;
    &lt;/node1&gt;
   &lt;/node&gt;
   &lt;node&gt;
    ......
   &lt;/node&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I want to insert the xsi:nil as an attribute of 'targetNode' for this document.</p>
  
  <pre><code>@XML.modify( 'insert attribute xsi:nil {"true"} into (root/node/node1/targetNode) [1]') 
  </code></pre>
  
  <p>The above will insert the attribute into the first occurance of the targetNode in the @XML document. The insert statement however will only work on a single node. Is there any way I can insert this attribute into all instances of targetNode in the @XML document.</p>