if (parent instanceof SOAPEnvelope) {
((SOAPEnvelope) parent).getBody().getFirstOMChild().detach();
((SOAPEnvelope) parent).getBody().setFirstChild(result);
} else {
parent.getFirstOMChild().detach();
parent.addChild(result);
}
} catch (TransformerException e) {
handleException("Error performing XSLT transformation " + xsltKey, e);
} catch (XMLStreamException e) {