Sadly, it was done manually. I had to migrate it to this brand new bleeding edge technology, Apache Velocity. That's not great either, but it's much less terrible than XSLT.
For that task I had to learn two templating languages at the same time to port it from one to the other. Wasn't an easy task.