As I see, you want to change node name starting with Test,
replacing Test with aaa.
To perform this task you need a template matching elements,
which names start with Test.
It can be made using a predicate in match attribute:
match="*[starts-with(name(), 'Test')]"
The content of this template should include:
- Create a new element, with changed name (aaa + the "rest"
of the tag name).
- Apply templates to the content of the current element,
like in the identity template.
- Close the just created element.
Of course, the script should include also the identity template.
So the whole script can look like below:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="*[starts-with(name(), 'Test')]">
<xsl:element name="aaa{substring(name(), 5)}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
</xsl:template>
</xsl:transform>