<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="someVariable">defaultValue</xsl:param>
<xsl:param name="anotherVariable"/>
<xsl:template match="foo">
<output>
<xsl:attribute name="attr">
<xsl:value-of select="$someVariable"/>
</xsl:attribute>
<xsl:apply-templates select="$anotherVariable"/>
</output>
</xsl:template>
<xsl:template match="bar">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
</xsl:stylesheet>