The XML-parser has a setting that limits the value of maxOccurs to 5000. Assuming that it is about the Java-XML-parser, this might help: https://stackoverflow.com/questions/16651005/workaround-for-xmlschema-not-supporting-maxoccurs-larger-than-5000#26628061
This propertysetting seems likely to solve it, though you will have to find out where to change this setting:
System.setProperty("jdk.xml.maxOccurLimit", "XXXXX");