}
if(c_id == null) {
element = bytes;
} else {
DOMRecord include = new DOMRecord(field.getLastXPathFragment().getLocalName());
include.setSession(session);
include.put(includeField, c_id);
element = include;
// Need to call setAttributeNS on the record, unless the xop prefix
// is defined on the descriptor's resolver already
NamespaceResolver resolver = ((XMLField) getField()).getNamespaceResolver();
if (resolver == null || resolver.resolveNamespaceURI(XMLConstants.XOP_URL) == null) {
resolver = new NamespaceResolver();
resolver.put(XMLConstants.XOP_PREFIX, XMLConstants.XOP_URL);
String xpath = XMLConstants.XOP_PREFIX + XMLConstants.COLON + INCLUDE;
XMLField incField = new XMLField(xpath);
incField.setNamespaceResolver(resolver);
Object obj = include.getIndicatingNoEntry(incField);
if (obj != null && obj instanceof DOMRecord) {
if (((DOMRecord) obj).getDOM().getNodeType() == Node.ELEMENT_NODE) {
((Element) ((DOMRecord) obj).getDOM()).setAttributeNS(XMLConstants.XMLNS_URL, XMLConstants.XMLNS + XMLConstants.COLON + XMLConstants.XOP_PREFIX, XMLConstants.XOP_URL);
}
}