output_1-input.xml
<?xml version="1.0"?>
<products>
<product>
<name>Delta</name>
</product>
</products>
output_1-stylesheet.xsl
<?xml version="1.0"?>
<xsl:stylesheet
version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="xml" omit-xml-declaration="no" encoding="UTF-8" indent="yes"/>
<xsl:template
match="/">
<Products>
<Product>
<Name>
<xsl:value-of
select="products/product/name"/>
</Name>
</Product>
</Products>
</xsl:template>
</xsl:stylesheet>
output_1-output.xml
<?xml version="1.0" encoding="UTF-8"?>
<Products>
<Product>
<Name>Delta</Name>
</Product>
</Products>
The element xsl:output is used to control serialization. We use method="xml" to make output to "xml" explicit ("xml" is default). To make you aware of some of the other optional attibutes, we use omit-xml-declaration="no" ("no" is default), and encoding="UTF-8" ("UTF-8" er default.), and we use indention="yes" ("no" is default).
Updated 2009-03-19