PrepTags is a file preparation software which allows to prepare files for translation in most CAT tools. Export formats include tagged RTF (Wordfast, DV, Trados, MemoQ), ttx (native TagEditor format), XLIFF (Virtaal, OmegaT, Heartsome...), TXML (native format for Wordfast Pro) and text (simplified tagged RTF format.
Files are prepared by defining a taglist, which is essentially a list of regular expressions enhanced with tagging features. This allows for the preparation of almost any text-based format, including XML, php, asp, po files..., even if they do not follow the standard rules of the format.
PrepTags is not open source, but there is a free, functional Lite version.