<p>My problem is that my XML document contains snippets of XHTML within it and while passing it through an XSLT I would like it to render those snippets without mangling them.</p>

<p>I've tried wrapping the snippet in a CDATA but it doesn't work since less than and greater than are translated to &lt; and &gt; as opposed to being echoed directly.</p>

<p>What's the XSL required for doing this?</p>

[{'answer_id': 56858, 'author': 'Apocalisp', 'author_id': 3434, 'author_profile': 'https://Stackoverflow.com/users/3434', 'pm_score': 0, 'selected': False, 'text': '<p>xsl:copy-of</p>\n'}, {'answer_id': 58466, 'author': 'DaveP', 'author_id': 3577, 'author_profile': 'https://Stackoverflow.com/users/3577', 'pm_score': 1, 'selected': False, 'text': '<p>Assuming your xhtml is in an element YYY\n\n\n\n\n</p>\n\n<p><a href="http://www.dpawson.co.uk/xsl/sect2/N1930.html" rel="nofollow noreferrer">http://www.dpawson.co.uk/xsl/sect2/N1930.html</a> explains options</p>\n'}, {'answer_id': 58471, 'author': 'Greg Hewgill', 'author_id': 893, 'author_profile': 'https://Stackoverflow.com/users/893', 'pm_score': 4, 'selected': True, 'text': '<pre><code>&lt;xsl:template match="@*|node()"&gt;\n  &lt;xsl:copy&gt;\n    &lt;xsl:apply-templates select="@*|node()"/&gt;\n  &lt;/xsl:copy&gt;\n&lt;/xsl:template&gt;\n</code></pre>\n\n<p>This is referred to as the "identity transformation" in the <a href="http://www.w3.org/TR/xslt#copying" rel="noreferrer">XSLT specification</a>.</p>\n'}, {'answer_id': 13282569, 'author': 'Alexis Wilke', 'author_id': 212378, 'author_profile': 'https://Stackoverflow.com/users/212378', 'pm_score': 2, 'selected': False, 'text': '<p>I ran in that problem and the copy-of is certainly the easiest to use. The identity works, but that\'s 5 lines of code and you\'d need to call such a template, not just define it as is in your XSLT document (otherwise you probably won\'t get what you expected in your output.)</p>\n\n<p>My main problem actually was to copy the content of a tag, and not the tag itself. It\'s actually very easy to resolve but it took me a little time to figure it out (maybe because QtXmlPatterns crashes quite a bit!)</p>\n\n<p>So, the following copies the tag named here and all of its children:</p>\n\n<pre><code>&lt;xsl:copy-of select="this/tag/here"/&gt;\n</code></pre>\n\n<p>But most often you do not want to do that because &lt;here&gt; is actually the container, in other words, it should not appear in the output. In that case you can simply do this:</p>\n\n<pre><code>&lt;xsl:copy-of select="this/tag/here/*"/&gt;\n</code></pre>\n\n<p>This copies all the children found in the tag named &lt;here&gt;.</p>\n'}]
['https://Stackoverflow.com/questions/56837', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2443/']