Yes Erwin,
I fact, this might be ideal for your situation.
From an automation process, obtain the Project interface. You can do this by, for example, calling Repository.GetProjectInterface().
From the project interface call ExportPackageXMI(). There is also an ImpoortPackageXMI() function to make things complete. You'll want to read through the parameters to understand the options. They are in section 15.1.2.9.1 of the EA User Guide (as of build 790).
[There is - IMHO - a glaring hole in this solution: you can only export to a file, rather than capture the resultant XMI as a string. I can see the logic here, as XMI strings can be very long, and some systems, languages, processors, etc. prefer long XML (and thus XMI) strings to be streamed (which might have been a bit much to ask for during development of the EA API) . Still, I would have liked the option...]
Given the above limitation, grab the file once EA has finished (it is synchronous, so you can do it when the function returns). Then you can run it through your own XSLT (for example) filters and such. Remember to be very careful not to trash things if you are going to do a later import.
HTH,
David