title: Replace value of one single node
body: <p>let's say I have this input file</p>
  
  <pre><code>&lt;root&gt;
  
      &lt;keyword&gt;
          &lt;name&gt;foo&lt;/name&gt;
          &lt;value&gt;bar&lt;/value&gt;
      &lt;/keyword&gt;
      &lt;keyword&gt;
          &lt;name&gt;123&lt;/name&gt;
          &lt;value&gt;456&lt;/value&gt;
      &lt;/keyword&gt;
  
  &lt;/root&gt;
  </code></pre>
  
  <p>and I want this output:</p>
  
  <pre><code>&lt;root&gt;
  
      &lt;keyword&gt;
          &lt;name&gt;foobar&lt;/name&gt;
          &lt;value&gt;bar&lt;/value&gt;
      &lt;/keyword&gt;
          &lt;keyword&gt;
          &lt;name&gt;123&lt;/name&gt;
          &lt;value&gt;456&lt;/value&gt;
      &lt;/keyword&gt;
  
  &lt;/root&gt;
  </code></pre>
  
  <p>Now, I have this working transformation, but I want to know how to make it more elegant.</p>
  
  <pre><code>&lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  &gt;
  
      &lt;!-- copy all nodes and attributes --&gt;
      &lt;xsl:template match="@*|node()" name = "identity"&gt;
          &lt;xsl:copy &gt;
              &lt;xsl:apply-templates select="@*|node()"/&gt;
          &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template match = "/root/keyword/name[text() = 'foo']"&gt;
          &lt;name&gt;foobar&lt;/name&gt;
      &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>After matching the desired node, I am repeatedly setting it again instead of simply replacing it. Can I do this more elegantly? My request may sound a little ridiculous, but I want to dig deeper into xslt and understand better.</p>
  
  <p>Thanks very much!</p>