if ((obj != null) && obj instanceof Element) {
result = (Element) obj;
} else if (obj != null) {
try {
JAXBContext jcontext = JAXBContext.newInstance(this.eventPkg);
Marshaller marshaller = jcontext.createMarshaller();
Document doc = getTargetDocument();
if (obj instanceof JaxbEventBase) {
JaxbEventBase jeb = (JaxbEventBase)obj;
marshaller.marshal(jeb.getMarshallableType(), doc);
} else {
marshaller.marshal(obj, doc);
}
result = doc.getDocumentElement();
} catch (JAXBException e) {
throw new TranslationException("Unable to marshall response", e); //$NON-NLS-1$
} catch (Exception e) {