*/
public AbstractRecord buildRow(Object object, AbstractSession session, DatabaseField xmlField, XMLRecord parentRecord) {
if (isXmlDescriptor() && ((XMLDescriptor)getDescriptor()).shouldPreserveDocument()) {
Object pk = extractPrimaryKeyFromObject(object, session);
if ((pk == null) || (pk instanceof CacheId) && (((CacheId)pk).getPrimaryKey().length == 0)) {
pk = new CacheId(new Object[]{ new WeakObjectWrapper(object) });
}
CacheKey cacheKey = session.getIdentityMapAccessorInstance().getCacheKeyForObject(pk, getDescriptor().getJavaClass(), getDescriptor(), false);
if ((cacheKey != null) && (cacheKey.getRecord() != null)) {
XMLRecord nestedRecord = (XMLRecord)cacheKey.getRecord();
nestedRecord.setMarshaller(parentRecord.getMarshaller());