In Saxon-SA, the instruction
<xsl:copy-of select="$doc" validation="strict"/>
correctly validates the document $doc, but returns an empty sequence as its result rather than the validated document.