Simon,
From what you are describing, it seems like it loops too much, and generate an extremely large number of pages. This could happen if your condition is incorrect, and always true, no matter what line of data it's reading. Did you double-check your condition, and make sure it's only true on particular lines?
If the condition is fine, and it still doesn't work, there are other ways to do overflow that might work better with XML. If you're interested, please open a support issue. Go on the main web page, and choose Services->Support->Report an issue. Once the issue is opened, a tech will contact you, and help you solve this problem.
Regards,
Rapha