}
if ((result instanceof SAXResult) && (!isFragment())) {
((SAXResult)result).getHandler().startDocument();
}
transformer.transform(source, result);
if ((result instanceof SAXResult) && (!isFragment())) {
((SAXResult)result).getHandler().endDocument();
}
} catch (TransformerException e) {
throw XMLPlatformException.xmlPlatformTransformException(e);