document = xmlRow.getDocument();
Element docElement = document.getDocumentElement();
object = ((Root) object).getObject();
}
XMLObjectBuilder bldr = (XMLObjectBuilder) descriptor.getObjectBuilder();
AbstractSession objectSession = context.getSession(object);
xmlRow.setSession(objectSession);
xmlRow.addXsiTypeAndClassIndicatorIfRequired(descriptor, null, null, originalObject, object, isXMLRoot, true);
xmlRow.setMarshaller(this);
if (shouldCallSetAttributeNS && !isRootDocumentFragment) {
((Element) xmlRow.getDOM()).setAttributeNS(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI, javax.xml.XMLConstants.XMLNS_ATTRIBUTE + XMLConstants.COLON + XMLConstants.SCHEMA_INSTANCE_PREFIX, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
}
xmlRow = (XMLRecord) bldr.buildRow(xmlRow, object, objectSession, isXMLRoot);
document = xmlRow.getDocument();
addSchemaLocations(document, session);
return document;