I wanted to use a .xsl to guarantee consistency of hyperlinks across a number of XML extracts being formatted as .html reports. Each record has a primary key called ID - an automatically incrementing number - which is passed as a parameter to various reports, but never shown as a column in those reports. Here's how I did it.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table>
<xsl:for-each select="table/row">
<tr>
<xsl:apply-templates>
<!-- id is primary key and is passed as a parameter to all the templates whether they need it or not -->
<xsl:with-param name="id"><xsl:value-of select="id"/></xsl:with-param>
</xsl:apply-templates>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="id">
<!-- id is primary key and is never shown -->
</xsl:template>
<xsl:template match="employee_number">
<!-- employee_number field always links to the attendance report -->
<xsl:param name="id"/>
<xsl:variable name="name"><xsl:value-of select="name(.)"/></xsl:variable>
<td id="{$name}"><a href="attendance?id={$id}"><xsl:value-of select="."/></a></td>
</xsl:template>
<!-- other templates redacted for clarity/brevity -->
<xsl:template match="*">
<!-- any field without a dedicated template is just a cell in the table -->
<xsl:variable name="name" select="name(.)"/>
<td id="{$name}"><xsl:value-of select="."/></td>
</xsl:template>
</xsl:stylesheet>