output doctype-system="testOut.dtd"
File: Data.xml <test>test</test> File: Transform.xslt <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output doctype-system="testOut.dtd" /> <xsl:template match="test"> <testOut> test. <xsl:apply-templates /> </testOut> </xsl:template> </xsl:stylesheet> Output: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE testOut SYSTEM "testOut.dtd"> <testOut> test. test</testOut>