Matching an Element by its ID
The syntax for matching an element by its ID is the same as the syntax for an Xpointer:
<xsl:template match="id([id-value])">
where id-value is the specific value of the ID attribute that you want to select by. This fragment of XSL code in the style sheet:
<xsl:template match= "id(1)">
could select this fragment of XML code in the XML document:
<line id="1">See the Happy Moron!</line>