The following conversion shows two ways to achieve this - with and without using functions <xsl:key>and key():
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"/>
<xsl:key name="kValueByKey"
match="value" use="normalize-space(../key)"/>
<xsl:template match="/">
1. By key: <xsl:text/>
<xsl:copy-of select="key('kValueByKey', 'foo')"/>
2. Not using key: <xsl:text/>
<xsl:copy-of select="/*/*[normalize-space(key)='foo']/value"/>
</xsl:template>
</xsl:stylesheet>
normalize-space(), <key>.