lemme get this straight... you have something like this:
$imageData = xmlImageDataThingy();
and you want to show that image data as an image on a web page. I think you could use 2 scripts, one that the user would explicitly request and one that outputs the image.
user requests a page with this code on it:
<img src="phpImage.php?image=myImg">
and phpImage.php is something like this:
header ("Content-type: image/png");
echo xmlImageDataThingy($image);