well, I think that the best way is to create your own format (.myformat or .data). This file will be in fact a Zip file that contains your XML file and images.
There is no perfect example writen in java as far as I know. However, here are some examples :
Not in java
- The best example is, as @Bolo said, the odt format. Indeed, OpenOffice writes the doc in an xml file, and the images too. All that is wrapped in an odt file.
- The .exe file is an other example. The C files and the resources are put in a single file. try to open it with 7-zip, you'll see.
- The Skyrim plugins are .esp file that contain the dds, the scripts, the niffs (textures)...
In java
- The minecraft texture packs are a zip file that contains a .mcmeta file (the infos) and the textures (.png)
- Jar files are like exe.