How about
:
<xsl:template match="element">
<xsl:call-template name="att">
<xsl:with-param name="atts" select="@*"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template name="att">
<xsl:param name="atts"/>
<xsl:if test="$atts">
<xsl:element name="{$atts[1]/name()}">
<xsl:call-template name="att">
<xsl:with-param name="atts" select="$atts[position() != 1]"/>
</
</
</
</
As it happens, this is pure XSLT 1.0.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference