}
if (objectValue instanceof String) {
marshalSimpleValue(xmlRootFragment, marshalRecord, originalValue, object, objectValue, session, namespaceResolver);
} else {
CoreSession childSession = null;
try {
childSession = marshaller.getContext().getSession(objectValue);
} catch (XMLMarshalException e) {
marshalSimpleValue(xmlRootFragment, marshalRecord, originalValue, object, objectValue, session, namespaceResolver);
return true;
}
Descriptor descriptor = (Descriptor) childSession.getDescriptor(objectValue);
ObjectBuilder objectBuilder = (ObjectBuilder) descriptor.getObjectBuilder();
List extraNamespaces = objectBuilder.addExtraNamespacesToNamespaceResolver(descriptor, marshalRecord, session, true, true);
if(wasXMLRoot){
setupFragment(((Root) originalValue), xmlRootFragment, marshalRecord);