<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:exsl="http://exslt.org/common"
                extension-element-prefixes="exsl">
	<!-- <xsl:import href="http://hwi.ath.cx/xslt/src/lib/exslt/exsl/exsl.xml" /> -->
	<!-- <xsl:import href="http://hwi.ath.cx/xslt/src/lib/exslt/exsl/exsl.xsl" /> -->
	<xsl:import href="../xmlverbatim.xsl"/>
	<xsl:output method="html" />
	<!-- From w3c spec: Expressions can only return values of type result tree
	fragment by referencing variables of type result tree fragment or calling
	extension functions that return a result tree fragment or getting a system
	property whose value is a result tree fragment. -->
	<xsl:template match="/">
		<html>
			<body>
				<xsl:variable name="direct" select="//*"/>
				<xsl:variable name="indirect">
					<xsl:call-template name="ReturnXml" select="."/>
				</xsl:variable>
				Direct count: <xsl:value-of select="count($direct)"/><BR/>
				Indirect count: <xsl:value-of select="count($indirect)"/><BR/>
				<!--
				Indirect count: <xsl:value-of select="count(exsl:node-set($indirect)/node())"/><BR/>
				-->
				<!--
				<xsl:for-each select="$direct">
					<B>DIRECT: <xsl:apply-templates select="." mode="xmlverb"/></B><BR/>
				</xsl:for-each>
				-->
				<xsl:call-template name="ReturnXml" select="."/>
			</body>
		</html>
	</xsl:template>
	<xsl:template name="ReturnXml">
		<xsl:copy-of select="//*"/>
		<xsl:for-each select="//*">
			<B>INDIRECT: <xsl:apply-templates select="." mode="xmlverb"/></B><BR/>
		</xsl:for-each>
	</xsl:template>

</xsl:stylesheet>

