As youve already seen, you can match the root node with the match pattern / like this:
<xsl:template match="/"> <HTML> <xsl:apply-templates/> </HTML> </xsl:template>