// consume mixed values, so this doesn't occur repeatedly in every branch
while (occurs<max) {
index = produceMixed(rdf.getModel().getSeq(rdf),index,element);
int x = index;
for (int i = 0; _any != null && i < _any.size() && x==index; i++) {
XMLBean bean = (XMLBean) _any.elementAt(i);
if (bean instanceof element) {
index = ((element) bean).toXML(element, rdf, index, pending, ctx);
} else if (bean instanceof any) { // any remaining
index = ((any) bean).toXML(element, rdf, index, pending, ctx);
} else if (bean instanceof choice) {