title: replace value of element by xquery
body: <p>I found this existing post on replacing the value of a given element, but I need to go further with my requirment in that I need to replace the first character with another.
  This is the post I found: <B>change value of element by xquery</B></p>
  
  <p>Source XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;category&gt;
      &lt;catid&gt;1&lt;/catid&gt;
      &lt;cattext&gt;sport&lt;/cattext&gt;
  &lt;/category&gt;
  </code></pre>
  
  <p>Using this Xquery:</p>
  
  <pre><code>declare namespace local = "http://example.org";
  declare function local:copy-replace($element as element()) {
    if ($element/self::cattext)
    then &lt;cattext&gt;art&lt;/cattext&gt;
    else element {node-name($element)}
                 {$element/@*,
                  for $child in $element/node()
                  return if ($child instance of element())
                         then local:copy-replace($child)
                         else $child
                 }
  };
  local:copy-replace(/*)
  </code></pre>
  
  <p>Gives this output:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;category&gt;
      &lt;catid&gt;1&lt;/catid&gt;
      &lt;cattext&gt;art&lt;/cattext&gt;
  &lt;/category&gt;
  </code></pre>
  
  <p>My knowledge of Xquery is only just starting grow. How do I change the above Xquery to only change the first character so that I get the below output:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;category&gt;
      &lt;catid&gt;1&lt;/catid&gt;
      &lt;cattext&gt;9port&lt;/cattext&gt;
  &lt;/category&gt;
  </code></pre>