public void transform(Document sourceDocument, Node resultParentNode, URL stylesheet) throws XMLPlatformException {
try {
XSLProcessor xslProcessor = new XSLProcessor();
XSLStylesheet xslStylesheet = xslProcessor.newXSLStylesheet(stylesheet);
XMLDocument xmlDocument = (XMLDocument)sourceDocument;
XMLDocumentFragment resultDocumentFragment = xslProcessor.processXSL(xslStylesheet, xmlDocument);
resultParentNode.appendChild(resultDocumentFragment);
} catch (XSLException e) {
throw XMLPlatformException.xmlPlatformTransformException(e);
}
}