object = createXMLRootFromJAXBElement((JAXBElement) object);
} else if(object != null && object.getClass().isEnum()) {
object = wrapEnumeration(object, object.getClass());
}
try {
XMLEventWriterRecord record = new XMLEventWriterRecord(eventWriter);
record.setMarshaller(this.xmlMarshaller);
this.xmlMarshaller.marshal(object, record);
} catch (Exception ex) {
throw new MarshalException(ex);
}
}