Just cut the XSLT code to a shockingly small 42 lines. Wow.
The XLST that converts the repository theme xml fragments into WebObjects .wod strings is only 16 lines... The XSLT that produces the .html strings from the same xml fragments weighs in at 26 lines.
Smaller is better. Less code, less to maintain, less to go wrong...