Right. And I do this in APEX (that is, APEX proper) in one or two places where this comes up.
If it doesn't create too much clutter, I might also do
<element component="versionA">
<element component="versionB">
Not ideal if they're identical but it does what it needs to.
This is coming up now because the other PROTEUS books now have a "playground version", so Vilma wants one for APEX, too.
It needs a new document ID for Runestone, and that can't go in the same component as the one for the main PROTEUS version, so a new component is needed.
Can't include both, so all the exercises in the PROTEUS version get omitted.
But of course, people want to see both new *and* old questions in the playground course.
I guess what I could do is put the document IDs in components just for the IDs:
<document-id component="proteus-id">
<document-id component="playground-id">
<exercise component="proteus">
<exercise component="playground">
One pub file with include="proteus proteus-id"
Another pub file with include="playground-id proteus playground"