Xml gallery doesnt work...gets stuck. please help!

Hi! i got an image gallery that reads data from an xml file. this xml formatted data is from a php file. when i open the gallery it loads the 1st image; when i click next it loads the 2nd and so forth… but as soon as it has loaded all the images once, it gets stuck. i dont know what to do. when i had the gallery read directly from an .xml file things were working fine but as soon as it was data from a php file that was xml formatted this problem started to occur. has anyone had this problem before? can anyone help me please?

thanks in advance!