<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="top"> <html> <body> <h1>Matched the root node</h1> <xsl:apply-templates select="node[@a='1']"/> </body> </html> </xsl:template> <xsl:template match="node"> <h2>Matched a child node</h2> position=<xsl:value-of select="position()"/>, <xsl:value-of select="."/>, preceding-sibling is <xsl:value-of select="preceding-sibling::node()"/> </xsl:template> </xsl:stylesheet>