Well, if you do it via PHP you don't really need AJAX, though you may still use XML.
The easy way to do it is via AJAX, just get a standard image and load the data on top using CSS and AJAX.
But in this case it's the first option, PHP script grabbing server varibles (if you're doing it internally XML isn't really needed as only you will see the mess) and putting it on the image using PHP's GD functions.