public XMLMarshaller getXmlMarshaller() { XMLMarshaller marshaller = xmlMarshallerMap.get(Thread.currentThread()); if (marshaller == null) { marshaller = getXmlContext().createMarshaller(); marshaller.setMarshalListener( new SDOMarshalListener(marshaller, (SDOTypeHelper) aHelperContext.getTypeHelper())); xmlMarshallerMap.put(Thread.currentThread(), marshaller); } XMLContext context = getXmlContext(); if (marshaller.getXMLContext() != context) { marshaller.setXMLContext(context); } return marshaller; }