FieldsPreprocessor.complexifyFields(pkgOut.getMainDocumentPart() );
log.debug("complexified: "
+ XmlUtils.marshaltoString(pkgOut.getMainDocumentPart().getJaxbElement(), true));
// find fields
ComplexFieldLocator fl = new ComplexFieldLocator();
new TraversalUtil(pkgOut.getMainDocumentPart().getContent(), fl);
log.info("Found " + fl.getStarts().size() + " fields ");
// canonicalise and setup fieldRefs
List<FieldRef> fieldRefs = new ArrayList<FieldRef>();
for( P p : fl.getStarts() ) {
int index = ((ContentAccessor)p.getParent()).getContent().indexOf(p);
P newP = FieldsPreprocessor.canonicalise(p, fieldRefs);
((ContentAccessor)p.getParent()).getContent().set(index, newP);
/*