Thanks Bruce,
That was your typical wise advice. I followed it and created my own routine that builds the packet with the desired xHTML from a database record. That logic is pretty straight forward.
But, I looked at the packet info that the template generates for xHTML that was added in the template and I see that you manipulate the xHTML. For example, you add < in front of any < characters (like <<div id> whereas the xHTML is <div id>. Also, you add <13,10> at the end of every line.
What I'm wondering is can I call a NT routine that does that modification to a line of xHTML (I could not find one), or do I have to write my own routine to mimic the changes that the template generates?
Mike