// create a byte array output stream and serialize the source node into it
ByteArrayOutputStream baosForSource = new FixedByteArrayOutputStream(BYTE_ARRAY_SIZE);
XMLStreamWriter xsWriterForSource = XMLOutputFactory.newInstance().
createXMLStreamWriter(baosForSource);
sourceNode.serialize(xsWriterForSource);
isForSource = new ByteArrayInputStream(baosForSource.toByteArray());
transformSrc = new StreamSource(isForSource);
transformTgt = new StreamResult(baosForTarget);
} catch (XMLStreamException e) {