There can be several reasons for this but one of the most common is that the content you are reading is not set to text/html.
In PHP you set it:
php Code:
header("Content-type: text/xml");
An easy way to tell is to load your output into your browser. It should appear in XML format (with a tree like structure) and not just plain text.