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