title: Multiple replacements in XML using XSLT
body: <p>I have xml that looks like below:</p>
  
  <pre><code>&lt;tests&gt;
  &lt;testcases id="1"&gt;
  &lt;command value="copy"&gt;
  &lt;files value="$$path$$/1.txt $$path$$/2.txt" /&gt;
  &lt;/testcases&gt;
  </code></pre>
  
  <p>My xsl file looks like</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
  &gt;
  &lt;xsl:param name="path"&gt;##MISSING##&lt;/xsl:param&gt;
   &lt;xsl:output method="xml" indent="yes" encoding="utf-8"/&gt;
  
    &lt;xsl:template match="@* | node()"&gt;
      &lt;xsl:copy&gt;
        &lt;xsl:apply-templates select="@* | node()"/&gt;
      &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;
  &lt;xsl:template match="@*"&gt;
  &lt;xsl:param name="find"&gt;$$project$$&lt;/xsl:param&gt;
  &lt;xsl:variable name="attribute-name" select="name()"/&gt;
      &lt;xsl:choose&gt;
        &lt;xsl:when test="contains(., $find)"&gt;
          &lt;xsl:attribute name="{$attribute-name}"&gt;
            &lt;xsl:value-of select="concat(substring-before(., $find), $path, substring-after(., $find))"/&gt;
          &lt;/xsl:attribute&gt;
        &lt;/xsl:when&gt;
  &lt;xsl:otherwise&gt;
          &lt;xsl:copy&gt;
            &lt;xsl:apply-templates select="@* | node()"/&gt;
          &lt;/xsl:copy&gt;
        &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
    &lt;/xsl:template&gt;
  </code></pre>
  
  <p>When I run the xsl tool, I get the output as </p>
  
  <pre><code>&lt;tests&gt;
  &lt;testcases id="1"&gt;
  &lt;command value="copy"&gt;
  &lt;files value="E:/test/1.txt $$path$$/2.txt" /&gt;
  &lt;/testcases&gt;
  </code></pre>
  
  <p>Could you please suggest what needs to be done to replace the second $$path$$ ?</p>