The xsl:output element allows stylesheet authors to specify how they wish the result tree to be output. If an XSLT processor outputs the result tree, it should do so as specified by the xsl:output element; however, it is not required to do so. The xsl:output element is only allowed as a top-level element.This stylesheet outputs as html and This stylesheet as xml. Compare how empty tags are outputed.
In the absence of xml:output element the default output method is xml (This stylesheet), but if document element of the output has value html (case insensitive) , then html method is used (This stylesheet).
The html output method should not output an end-tag for empty elements specified in HTML specification.The html output method should not perform escaping for the content of the script and style elements (look at source of the lowest middle window in your browser) . Consult XSLT specification for more details.
The encoding attribute specifies the preferred encoding to be used. The html output method should add a META element immediately after the start-tag of the HEAD element specifying the character encoding actually used. This stylesheet outputs in UTF-8, This stylesheet in UTF-16, and This stylesheet in Cp1250. In This stylesheet look at the source of the lowest middle window in your browser. The xml source contains characters which are not present in specified character set and they are therefore escaped.
The text output method outputs the result tree by outputting the string-value of every text node in the result tree in document order without any escaping. Look at the source in your browser to see the output.