Code example for DOMSource

0
            OMElement payload = OMUtils.toOM(mex.getInMessage().getContent()); 
            OMElement response = service.invoke(mex.getOperation().getLocalPart(), payload); 
            NormalizedMessage nresponse = null; 
            if (response != null) { 
                nresponse = mex.createMessage(); 
                nresponse.setContent(new DOMSource(OMUtils.toDOM(response))); 
            } 
            return nresponse; 
        } catch (Exception e) { 
            throw new RuntimeException(e); 
        } 
    } 
 
}