<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">
  <xsl:param name="pathPropName" select="'path'"/>
  <xsl:output method="xml" omit-xml-declaration="yes"/>
  <!-- erase the old path -->
   <xsl:template match="attribute[@name=$pathPropName]"/>
   <xsl:template match="item">
     <xsl:param name="path" select="''"/>
     <xsl:variable name="noteName" select="attribute[@name='Name']/text()"/>
     <xsl:variable name="newPath" select="concat($path,'/',$noteName)"/>
     <xsl:copy>
       <xsl:apply-templates select="@*"/>
       <attribute name="path">
         <xsl:attribute name="name">
           <xsl:value-of select="$pathPropName"/>
         </xsl:attribute>
         <xsl:value-of select="$newPath"/>
       </attribute>
       <xsl:apply-templates >
         <xsl:with-param name="path" select="$path"/>
       </xsl:apply-templates> 
     </xsl:copy>
   </xsl:template>

   <xsl:template match="*|text()|@*">
     <xsl:copy>
       <xsl:apply-templates select="@*"/>
       <xsl:apply-templates/> 
     </xsl:copy>
   </xsl:template>

</xsl:stylesheet>
