DOCUMENT();then it would be processed by PG, and if not, then it would be treated as it currently is. That would give backward compatibility. I hadn't thought about the missing variables or incomplete environment, but I suppose that could be handled as you have indicated.
I know that the dual set header files have been a pain historically. I went to a common screen-and-print file myself long ago, so have not given it much thought recently. I think you are right that PGML might be a good format for those. I should give that a try.