title: Replace part of URL in XML with xmlstarlet
body: <p>I would like to replace a part of URL with XMLStarlet.</p>
  <p><code>http://example.com:8081</code> to <code>http://example2.com</code></p>
  <p><strong>XML:</strong></p>
  <pre><code>&lt;SHOP&gt;
      &lt;SHOPITEMS&gt;
          &lt;SHOPITEM&gt;
              &lt;IMGURL&gt;http://example.com:8081/image.jpg&lt;/IMGURL&gt;
              &lt;IMAGES&gt;
                  &lt;IMGURL&gt;http://example.com:8081/image2.jpg&lt;/IMGURL&gt;
                  &lt;IMGURL&gt;http://example.com:8081/image3.jpg&lt;/IMGURL&gt;
              &lt;/IMAGES&gt;
          &lt;/SHOPITEM&gt;
      &lt;/SHOPITEMS&gt;
  &lt;/SHOP&gt;
  </code></pre>
  <p>As you can see the text I'd like to replace is on multiple levels in:</p>
  <p>/SHOP/SHOPITEMS/SHOPITEM/IMGURL<br />
  /SHOP/SHOPITEMS/SHOPITEM/IMAGES/IMGURL</p>
  <p>So far I tried:</p>
  <pre><code>xmlstarlet ed -u &quot;//SHOP/SHOPITEMS/SHOPITEM/IMGURL/*[starts-with(text(), 'http://example.com:8081')]&quot; -v http://example2.com input.xml
  </code></pre>
  <p>not worked... and:</p>
  <pre><code>xmlstarlet ed -u &quot;//SHOP/SHOPITEMS/SHOPITEM/IMGURL/text()&quot; -x &quot;str:replace(., 'http://example.com:8081', 'http://example2.com')&quot; input.xml
  
  xmlXPathCompOpEval: function replace not found
  Unregistered function
  Segmentation fault
  </code></pre>
  <p>Any help is appreciated.</p>