When using the DataContractSerializer to convert an object returned from a WCF call to XML, I encountered an issue where if I outputted the XML string directly to a label on a webpage, the browser would strip out the angle brackets. This got me thinking about how websites like StackOverflow handle displaying code snippets with angle brackets. Are they replacing the brackets with HTML entities manually or using some existing utility? StackOverflow seems to use a code tag within a pre tag and then style it with spans. Is there a free tool available for doing this rather than writing my own parsing routine? Any guidance on where to find such a utility or code snippet would be greatly appreciated. Apologies if this question is more suited for meta.stackoverflow. Thank you in advance for any advice.