copy-of_1-input.xml
<?xml version="1.0"?>
<products>
<product
id="p1">
<name>Delta</name>
<stock>4</stock>
</product>
</products>
copy-of_1-stylesheet.xsl
<?xml version="1.0"?>
<xsl:stylesheet
version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
indent="yes"/>
<xsl:template
match="/">
<catalog>
<xsl:copy-of
select="products/product"/>
</catalog>
</xsl:template>
</xsl:stylesheet>
copy-of_1-output.xml
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<product
id="p1">
<name>Delta</name>
<stock>4</stock>
</product>
</catalog>
The element xsl:copy-of is a deep copy, copying the context element with atttibutes and children elements and their children and attributes, etc. also comments and processing-instructions are copied.
Updated 2009-03-19