@waldoj
Clearly should have been ported to XSLT instead.