<xsl:choose>
<xsl:when test="$newrpath">
<xsl:variable name="segment" select="substring-before($rpath,$newrpath)"/>
<xsl:choose>
<xsl:when test="$newrpath">
<xsl:variable name="segment" select="substring-before($rpath,$newrpath)"/>
<xsl:with-param name="name" select="substring-before($segment,'/')"/>
</xsl:call-template>
<xsl:call-template name="mk_path">
<xsl:with-param name="name" select="substring-before($segment,'/')"/>
</xsl:call-template>
<xsl:call-template name="mk_path">