I have the following code (from a previous question on this site) which retrieves a certain image from an XML file:
You can use simplexml_load_file