You can easily write a custom merge driver that decompresses the inputs first. However:
... so that it could be merged as if it were an XML file
It's extremely difficult (read: impossible) to correctly merge XML with the tools provided with Git. See Can git be made to mostly auto-merge XML order-insensitive files? for details. In other words, once you have decompressed the three input files, there is no one correct action to take to merge the XML.
You do say as if it were, so perhaps a plain-text merge will work for your non-XML-but-XML-ish text. In this case, see git merge-file
, which will do a three-way merge on user-supplied text files. If the merge goes well you can re-compress the result, remove the decompressed intermediate files, and call the result sufficient. If not, you probably should leave the original three de-compressed files for the user to manually merge. (This part is of course up to you.)