How to invoke a step recursively?

I would like to invoke step level-1 of my pipeline [1] recursively. So
iteration n should invoke this step with using the output from
iteration n-1 as its input. I need to have also the output from all
the iterations explicit in result. How can I achive this?

Regards,
Manfred

[1] xpl:
<p:declare-step name="myPipeline"
	xmlns:c="http://www.w3.org/ns/xproc-step"
	xmlns:p="http://www.w3.org/ns/xproc">
	<p:option name="dir"/>
	<p:output port="result" sequence="true">
		<p:pipe step="level-0" port="result"/>
		<p:pipe step="level-1" port="result"/>
	</p:output>
	<p:serialization port="result" indent="true" omit-xml-declaration="false"/>
	<p:directory-list name="level-0">
		<p:with-option name="path" select="concat($dir,
'/')"><p:empty/></p:with-option>
	</p:directory-list>
	<p:make-absolute-uris match="*/c:directory/@name">
		<p:with-option name="base-uri" select="concat($dir, '/')"/>
	</p:make-absolute-uris>
	<p:for-each name="level-1">
		<p:iteration-source select="/c:directory/c:directory"/>
		<p:output port="result"/>
		<p:variable name="dirpath" select="concat(c:directory/@name, '/')"/>
		<p:directory-list>
			<p:with-option name="path" select="$dirpath"/>
		</p:directory-list>
		<p:make-absolute-uris match="*/c:directory/@name">
			<p:with-option name="base-uri" select="$dirpath"/>
		</p:make-absolute-uris>
	</p:for-each>
</p:declare-step>

Received on Friday, 11 September 2009 11:10:02 UTC