How to paste code and not have it formatted in Blogger

blogger

I'm trying to paste some example XML snippets into a blog post on blogger, but every time I save or preview the post, blogger seems to remove my XML tags and just display the parameters. I can't find a way of retaining code, there is no "code" button on the WYSIWYG editor

For example,

<MyTag>
 <myValue>some value</myValue>
</MyTag>

Becomes

some value

I've tried to surround it with the pre tag but that doesn't work either

Any ideas? I'd rather not have to screenshot code as that rules out copy/pasting in the future

Best Answer

I've been using tohtml to format code for a while, and I just tested its output with blogger and it works. It will even give you syntax highlighting.