while(containerPolicy.hasNext(iterator)) {
Object next = containerPolicy.next(iterator, null);
if(next instanceof XMLRoot) {
XMLRoot root = (XMLRoot)next;
QName name = new QName(root.getNamespaceURI(), root.getLocalName());
JAXBElement element = new JAXBElement(name, root.getObject().getClass(), root.getObject());
containerPolicy.addInto(element, results, null);
} else {
containerPolicy.addInto(next, results, null);
}
}
attributeValue = results;
} else {
if(attributeValue instanceof XMLRoot) {
XMLRoot root = (XMLRoot)attributeValue;
QName name = new QName(root.getNamespaceURI(), root.getLocalName());
JAXBElement element = new JAXBElement(name, root.getObject().getClass(), root.getObject());
attributeValue = element;
}
}
nestedAccessor.setAttributeValueInObject(object, attributeValue);
}