title: Printing Out The Value Of An XSL Variable
body: <p>Can someone please tell me how to print out a variable in my XSL transform? Seems like an easy enough thing to do but I just can't seem to do it.  Here's the code I have:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;xsl:stylesheet version="1.0"
    xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
    &lt;xsl:template name="ControlledListStructure"&gt;
      &lt;xsl:param name="xmlElem" /&gt;
      &lt;xsl:param name="dataName" /&gt;
  
      &lt;xsl:element name="{$xmlElem}"&gt;
        1: &lt;xsl:text&gt;{$xmlElem}&lt;/xsl:text&gt;.
        2: {$xmlElem}.
      &lt;/xsl:element&gt;
    &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>If I called this template with a value for xmlElem of "Wibble" (a string - not a node), I would get the following output:</p>
  
  <pre><code>&lt;Wibble&gt;
        1: {$xmlElem}.
        2: {$xmlElem}.
  &lt;/Wibble&gt;
  </code></pre>
  
  <p>So my parameter is coming over properly, I just can't access it properly.  Can someone tell me how I can get $xmlElem to print out properly so that I see:</p>
  
  <pre><code>&lt;Wibble&gt;
        1: Wibble.
        2: Wibble.
  &lt;/Wibble&gt;
  </code></pre>
  
  <p>Thanks for any input.</p>