Should you serialize your HTML to XHTML and serve it with a Content-Type of application/xhtml+xml (which you then should do), the solution would be two-fold:
First you can create a CDATA escape section, which tells any XML or HTML parser, that do not parse in HTML5 mode (that's why it is important to serialize to XHTML and serve as application/xhtml+xml), to disregard the contents in between <![CDATA[ and ]]> completely (effectively not parsing it at all, just passing it through):
<![CDATA[ cr<'az>y text you w</>ant to display verbatim. ]]>
All this does was to let you use those special characters, which would otherwise be considered to be markup. It simply lets the text "fall through".
Second, you need to place this CDATA section within a <pre></pre> element. This will take care of keeping the formatting of your XML as is (you may also want to add a <code></code> element, which may, depending on your use case, make your code semantically more sound). Should you leave this out, then the text, you want to display, will be shown with the styling of <span> elements, that is, as plain inline text, that adheres to the flow. This is, why a simple div around it, is not enough.
Following is a snippet, that I just tested successfully. Note that I have left the indentation, as it was in my source code, to emphasize, that it will be important to take the contents, you enclose within the pre element, out of indentation and place it the way you see it here, otherwise all the empty spaces before the text will be kept at the left of each line,since the result will be the contents verbatim:
<div>
<pre><![CDATA[
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>]]>
</pre>
</div>
A completely different option would be to entity-escape all those characters, which define markup. Most importantly these are < and > which would need to be expressed as < and > respectively. There is stand alone tools, that do this, but also some text editor plugins can do it. However, this requires an additional processing step and can complicate things. But you will still need the <pre> wrapper around your text. The positive aspect may be for some, that they wouldn't need to serialize to XHTML then.