I'm not familiar with ICU but I have become uncomfortably familiar with XSL transformations in the past year, and I wouldn't recommend doing anything so complex with them. I could see using an XML format for the raw text and run it through xsltproc to convert <...> to % (...) or [...] for other tools, perhaps.