<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="resultset" >
<groceries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:apply-templates select="*"/>
</groceries>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
outputs the following:
<?xml version="1.0"?>
<groceries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<sample>cereal</sample>
<count>1</count>
</row>
<row>
<sample>macaroni</sample>
<count>1</count>
</row>
<row>
<sample>cookies</sample>
<count>2</count>
</row>
<row>
<sample>rice</sample>
<count>2</count>
</row>
<row>
<sample>stuffing</sample>
<count>7</count>
</row>
</groceries>