up right
Variables
<xsl:variable name="" select="" >
<xsl:variable name="varempty" /> No selection made, empty
<xsl:variable name="varnumber" select="23" /> Recognised as number
<xsl:variable name="varstring" select="'a string'" />Quotes indicate string
<xsl:variable name="varfragment">
  <cd><artist>Armstrong</artist><title>My New Album</title></cd>
</xsl:variable>

<xsl:if test="position() = last()">
  <xsl:variable name="final">Completed</xsl:variable> Invalid outside if
</xsl:if>

<xsl:variable name="final">  Variable final can be used ouside if
<xsl:if test="position() = last()">Completed</xsl:if>
</xsl:variable>

<xsl:value-of select="$varstring" /> Using a variable
<xsl:copy-of select="$varfragment" />

<variable name="template_result"> Pass value out of template
<apply-templates select="cdlist" /> Result to the variable not Result Tree
</xsl:variable>