if (isFragment()) {
writerRecord.node(xmlDocument, xmlDescriptor.getNamespaceResolver());
} else {
writerRecord.startDocument(encoding, version);
writerRecord.node(xmlDocument, writerRecord.getNamespaceResolver());
writerRecord.endDocument();
}
} catch (XMLPlatformException e) {
throw XMLMarshalException.marshalException(e);
}
}