Import data into XWiki with attachments

I am importing data into an XWiki instance. The data comes from a different wiki platform and I am converting the text into the XML format that is understood by the XWiki importer (as seen when exporting an XWiki page) . Everything works very well and I can import many wiki pages into XWiki with the XWiki importer

My question is about attachments , for example images (mage1.png, image2.png etc) that are part of the old wiki pages. If I export an XWiki page with an attachment image then the image is exported in unintelligible code, so I cant use the export template as an example for importing an image.

Can someone post the correct xml for attaching an image or another file into an XWIki page

Also am I correct to assume that the default storage for 12.4 for images is in the relational Database?

Thanks for any reply