<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />

<xsl:key name="byColor" match="item" use="favouriteColor" />
<xsl:key name="birthYear" match="item" use="favouriteColor" />

<xsl:template match="/">
   <html><head><title> Demo of &lt;xsl:key> element and key() function </title></head> 
    <body>
    <h3>Demo of &lt;xsl:key> element and key() function</h3>
    <p>
    <xsl:for-each select="key('byColor', 'red')" >
<xsl:text> &#32;
</xsl:text><xsl:value-of select="." /> 
    </xsl:for-each>
   </p>  </body></html>
</xsl:template>
</xsl:stylesheet>
