I don't know of an easy way to do that. You COULD do this:
- Use git filter-branch to add a ZZZ super-directory on the XXX repository
- Push the new branch to the YYY repository
- Merge the pushed branch with YYY's trunk.
I can edit with details if that sounds appealing.