The only information I could find on this suggested that three was the maximum number allowed. Is that incorrect?

I could change it to loop until headerN.xml doesn't exist perhaps?