title: XST - using output from call-template as return value
body: <p>Suppose i have a template <code>foo</code> which can output something given a parameter. Now I want to use that output as a parameter to my other template, <code>loop</code> so I can loop the output a certain number of times. I have tried something along the way of</p>
  
  <pre><code>    &lt;xsl:call-template name="loop"&gt;
          &lt;xsl:with-param name="times" select="someParam"/&gt;
          &lt;xsl:with-param name="output"&gt;
              &lt;xsl:call-template name="foo"&gt;
                  &lt;xsl:with-param name="type" select="something"/&gt;
              &lt;/xsl:call-template&gt;
          &lt;/xsl:with-param&gt;
      &lt;/xsl:call-template&gt;
  </code></pre>
  
  <p>In other words, <code>output</code> should now contain the output from the call to <code>foo</code>. Both <code>loop</code> and <code>foo</code> work fine independantely but it seems like I can't nest them this way. How should I accomplish this? Thanks in advance.</p>