title: How can I get a value from an xml key/value pair with xpath in my xslt?
body: <p>I have some xml that I want to process using xslt.  A good amount of the data comes through in key value pairs (see below).  I am struggling with how to extract the value base on the key into a variable.  I would like to be able to do something like this:</p>
  
  <pre><code>&lt;xsl:variable name="foo" select="/root/entry[key = 'foo']/value"/&gt;
  </code></pre>
  
  <p>but that doesn't seem to work.  Here is sample xml.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;root&gt;
    &lt;entry&gt;
      &lt;key&gt;
        foo
      &lt;/key&gt;
      &lt;value&gt;
        bar
      &lt;/value&gt;
    &lt;/entry&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>What would the correct xpath be for this?</p>