</head> <body> <table> <tbody> <tr> <th align="left">Product</th> <th>Price</th> </tr> <xsl:apply-templates select="//product"/> </tbody> </table> </body> </html> </xsl:template> <xsl:template match="product"> <tr> <td> <xsl:value-of select="name"/> </td> <td> <xsl:choose> <xsl:when test="price <= 20"> <xsl:attribute name="bgcolor">#e0e0e0</xsl:attribute> </xsl:when> <xsl:when test="price <= 100"> <xsl:attribute name="bgcolor">#00ff00</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="bgcolor">#FF0000</xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:value-of select="format-number(price, '#.00')"/> </td> </tr> </xsl:template> </xsl:stylesheet>