title: Rename namespace prefixes with XQuery (Update)
body: <p>The following problem can easily be solved with text processing tools and languages, but this is not how it should be done I guess.. </p>
  
  <p>What’s the cleanest and cheapest approach to rename namespace prefixes in a large XML document with XQuery (Update)?</p>
  
  <p><strong>Source:</strong></p>
  
  <pre><code>&lt;a:root xmlns:a="http://my.old.url/"/&gt;
    &lt;a:sub/&gt;
  &lt;/a:root&gt;
  </code></pre>
  
  <p><strong>The result I’d like to get:</strong></p>
  
  <pre><code>&lt;b:root xmlns:b="http://my.old.url/"/&gt;
    &lt;b:sub/&gt;
  &lt;/b:root&gt;
  </code></pre>
  
  <p>Any ideas?</p>