title: How to map values of an xml attribute to some other values
body: <p>I have a XML file similar to the following:</p>
  
  <pre><code>&lt;a&gt;
    &lt;b value="a123" /&gt;
    &lt;b value="b234" /&gt;
    &lt;b value="c345" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I need to map the attributes to some other value. For example, I want to replace <code>a123</code> with <code>q999</code>, <code>b234</code> with <code>z998</code> and <code>c345</code> with <code>u997</code>. Is it possible to do such transformation efficiently using XSLT? The mapping itself is generated, so I can convert it into almost any format. For now, let's say it's the following XML file:</p>
  
  <pre><code>&lt;map&gt;
    &lt;item from="c345" to="u997" /&gt;
    &lt;item from="b234" to="z998" /&gt;
    &lt;item from="a123" to="q999" /&gt;
  &lt;/map&gt;
  </code></pre>
  
  <p>Maybe there's a better tool than XSLT to do such transformation? Currently I just <code>sed</code> through the file many times. Obviously this solution is horribly inefficient and doesn't scale at all.</p>