xmlRec.setLeafElementType(xmlFld.getLastXPathFragment().getLeafElementType());
}
XMLRecord parent = (XMLRecord) databaseRow;
if (xmlReferenceDescriptor != null) {
XMLObjectBuilder objectBuilder = (XMLObjectBuilder) xmlReferenceDescriptor.getObjectBuilder();
XMLRecord child = (XMLRecord) objectBuilder.createRecordFor(attributeValue, (XMLField) getField(), parent, this);
child.setNamespaceResolver(parent.getNamespaceResolver());
child.setSession(session);
objectBuilder.buildIntoNestedRow(child, attributeValue, session, (XMLDescriptor)getReferenceDescriptor(), (XMLField) getField());
return child;
} else {
if (attributeValue instanceof Element && getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) {
return new DOMRecord((Element) attributeValue);
}else{