You are not alone. I've experimented with building a structured representation of the document before generating the actual page. The way I did it, the structure could contain substructures or arbitrary strings (like those produced by templates). I like this hybrid approach because it can take advantage of existing templates. - David