How to invert XML data tags via XSLT?


For example, below XML file.

<profession> Programmer</profession>

Now, In XSLT, IF I code,

<xsl:template match="person">
 <xsl:apply-templates/><xsl:text> </xsl:text>

So, In HTML file It will display: Adam Palmer Programmer 80,000.

But I need following output: Palmer Adam Programmer 80,000.

I need to reverse order of first 2 data tags.

Any idea folks ?

Push style stylesheet:

<xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:strip-space elements="*"/>
    <xsl:template match="person/*">
        <xsl:text> </xsl:text>
    <xsl:template match="person">
        <xsl:apply-templates select="lname"/>
        <xsl:apply-templates select="name"/>
        <xsl:apply-templates select="*[not(self::name|self::lname)]"/>


Palmer Adam  Programmer 80,000