I recently was looking for a good way to display HTML code in my content and looked at quite a few options. I never use the pre element but that is what was recommended. The problem with using the pre element is that it will process the html and won't display it so for every < and > you end up having to put in the ascii html code for it to get it printing.
I ran across the xmp element and kept reading that "the xmp element is depreciated". Well where ever that is coming from, seems to be incorrect. I tested it in IE6, IE7, Safari, Firefox, and Opera and it worked in all of them. The xmp element is the only element that will open and close and only process the html within the code as plaintext that I could find.
Below is an example using the xmp code:
Content goes here...
Anything within the <xmp> and </xmp> code will be printed as plaintext. I hope this has helped some one else out because it took some testing and searching to find this information out. Leave any comments in case there are any exceptions I missed. I believe the xmp element does not validate, but I haven't tested that yet.