Why not simply change the custom, quirky templating language to a standards-based, well-formed one and use XSL? Our company uses 3 different development architectures, but they all use XSL as the templating layer, and its speeded up development and roll-out of all our applications.
Why not just use XSL?