Validating the result using
xsl:validation attribute.<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="2.0">
<xsl:import-schema namespace="http://www.w3.org/1999/xhtml" schema-location="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" />
<xsl:template match="/">
<html xsl:validation="strict">
<head>
<title>Schema Aware XSLT example</title>
</head>
<body>
<div>Hello World</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<xsl:import-schema namespace="http://www.w3.org/1999/xhtml" schema-location="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" />
<xsl:template match="/">
<html xsl:validation="strict">
<head>
<title>Schema Aware XSLT example</title>
</head>
<body>
<div>Hello World</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>