<?xml version="1.0"?>
<xsl:stylesheet 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      version="1.0">   <xsl:variable name="vcvj" />
   <xsl:template match="/root">
        <xsl:apply-templates select="*"/><br/>
   </xsl:template>   <xsl:template match="*">
   
   <xsl:choose>
      <xsl:when test="name()='Leaf'">
        <xsl:value-of select="."/>
<br/>

<xsl:variable name="vcvj">
<xsl:value-of select="position()"/>
</xsl:variable>

<!--
You must write down a extending function here,
for more details please refer to MSXML SDK.
//building space to here,using $vcvj var.
-->
      </xsl:when>
    
      <xsl:otherwise>
<xsl:value-of select="@Name"/>
<br/>
<xsl:apply-templates select="*"/>
      </xsl:otherwise>
   </xsl:choose>
   
</xsl:template>
</xsl:stylesheet>