<!--- Match toes element. ---> <xsl:template match="toes"> <ul> <!--- Loop over toes. ---> <xsl:for-each select="toe"> <!--- Build an LI element. ---> <xsl:element name="li"> <!--- Check for class. ---> <xsl:if test="@isbigtoe = 'true'"> <xsl:attribute name="class"> <xsl:text>bigtoe</xsl:text> </xsl:attribute> </xsl:if> <!--- Output this value for the LI text. ---> <xsl:value-of select="name/text()" /> </xsl:element> </xsl:for-each> </ul> </xsl:template>