Ecco la soluzione!!

sostituire a sopra i match a span e div con i seguenti:

codice:
<xsl:template match="span">
<xsl:element name="span" >
    <xsl:copy-of select="./@*"/>
    <xsl:apply-templates />
</xsl:element>    
</xsl:template>

<xsl:template match="div">
<xsl:element name="div" >
    <xsl:copy-of select="./@*"/>
    <xsl:apply-templates />
</xsl:element>    
</xsl:template>