<?xml version="1.0"?>

<!-- build another XML from source XML -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

 <xsl:output method="xml" /> 

	<!--================= document template =================-->
	<xsl:template match="/">
		<people>
		<xsl:apply-templates select="/people/person"/>
		</people>
	</xsl:template>

	<!--================= person template =================-->
	<xsl:template match="person">
		<xsl:copy>				<!-- this will copy the node to the target tree -->
							<!-- but will not copy any children of the node -->

			<xsl:attribute name="firstname">  <xsl:value-of select="firstname"/></xsl:attribute>
			<xsl:attribute name="lastname">   <xsl:value-of select="lastname"/> </xsl:attribute>
		</xsl:copy>
	</xsl:template>

</xsl:stylesheet>