1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 2 <xsl:output method="xml" indent="yes" /> 3 <xsl:template match="aaa"> 4 <xsl:copy> 5 <xsl:copy-of select="@*" /> 6 <xsl:element name="aaa-ref"> 7 <xsl:attribute name="name">namevalue</xsl:attribute> 8 <xsl:attribute name="package">packagevalue</xsl:attribute> 9 </xsl:element> 10 </xsl:copy> 11 </xsl:template> 12 <xsl:variable name="this"> 13 <xsl:apply-templates select="aaa" /> 14 </xsl:variable> 15 <xsl:template match="/"> 16 <xsl:copy-of select="$this" /> 17 </xsl:template> 18 </xsl:stylesheet> 19