Question about WXR export routines

I have a question about how WXR exports are produced. We’re using the H5P plugin, which allows us to create interactive content and embed it in Pressbooks titles. The default method the plugin uses is via shortcode–each H5P activity exists only in the book which created it. This is just fine for the published books, and it even allows users to export the activities to another book manually by clicking an embed link which brings up an iframe that can be pasted anywhere else the user wants to put it. What I’m interested in doing is adding a script/routine to the WXR export process that would look for these H5P shortcodes and replace them with the full iframe references, so that the H5P activities would be intact when/if a book was exported/imported into another PB instance (they’d point to the original activities, which would remain published at the first i.e. source book). Does this sound like something that would be possible with the PB export routine, and if so, can someone point me to the place in the PB code that controls the WXR export?

Alternatively, it may make some sense to replace certain short codes with their fixed references at the the time of import? Any thoughts on this welcomed.