protected void transformContent(Transformer transformer, MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws TransformerException, MessagingException {
protected void transformContent(Transformer transformer, MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws TransformerException, MessagingException, ParserConfigurationException { Source src = in.getContent(); if (forceDocIfDom && src instanceof DOMSource) { Node n = ((DOMSource) src).getNode(); if (n instanceof Document == false) { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); doc.appendChild(doc.importNode(n, true)); src = new DOMSource(doc); } }
    protected void transformContent(Transformer transformer, MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws TransformerException, MessagingException {        if (isUseStringBuffer()) {            StringWriter buffer = new StringWriter();            Result result = new StreamResult(buffer);            transformer.transform(in.getContent(), result);            out.setContent(new StringSource(buffer.toString()));        }        else {            ByteArrayOutputStream buffer = new ByteArrayOutputStream();            Result result = new StreamResult(buffer);            transformer.transform(in.getContent(), result);            out.setContent(new BytesSource(buffer.toByteArray()));        }    }