Bug
It seems that there are two different sets of functions written to deal with exporting XLIFF to LocConnect, and exporting XLIFF to a file.
This has also resulted in duplicated bugs, such as <group> appearing in incorrect places in the XLIFF file (logged as separate bug #4).
Solution
Merge the code for both scenarios to simplify.