I'm not sure, but the way you probably need to go is to first place the image into the text and then markup the image with the xml you want...
Thanks for responding. I managed to figure this one out myself, although it is not exactly intuitive.
The empty tag (XMLElement) seems to have a a single, empty Text in its texts collection. Oddly enough, the Text class has a place method, so
works just fine.
I would have thought it contains a single InsertionPoint...
True. I just realized I could do .place() on an InsertionPoint.