By default WordPress will not display html tags or code in a published article. try it for yourself, copy a few lines of code and paste them into a published article!
Sometimes if you want to share code this is going to be a problem.
To get around this all you need to do is go to http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/Encode.aspx and encode your html code. This is as easy as copy and paste!
Now go to the article you want to have the code appear in and change from visual to text mode on the editor.
Paste the encoded text where you’d like it to appear
At the beginning of the code you have just pasted add <code> and at the end of the text add <code>
Your html code will now appear as it should do!
<title>Title of the document</title>
The content of the document......
You’ll notice that the code in this article stands out as it has it’s own text color and background color. This is achieved by editing your templates css file and adding / changing the relevant attributes of the #code section. Anything then written in between the code tags will look how you want it to.