You can do this by using codes for the characters that are used in html. For example the “greater than” > and “less than” > symbols that are used on tags will be written as < and >
So:
<p>A Paragraph.</p>
would be written:
<p>A Paragraph.</p>
This may be a but tedious to do, but if you use php you can use that to convert a string to this code using htmlentities .