So your problem is that the document is not ending at
HTML Code:
</LOT>
?

Everything after that is not XML tags, it is HTML. It looks to me like your output is having some sort of template applied to it as if it were a component of some other page.