//indicated we're marshalling a node
xmlDocument = (Node)((XMLRoot)object).getObject();
} else {
xmlDocument = objectToXML(object, xmlDescriptor, isXMLRoot);
}
DOMReader reader = new DOMReader();
reader.setProperty("http://xml.org/sax/properties/lexical-handler", lexicalHandler);
if (isFragment()) {
FragmentContentHandler fragmentHandler = new FragmentContentHandler(contentHandler);
reader.setContentHandler(fragmentHandler);
} else {
reader.setContentHandler(contentHandler);
}
reader.parse(xmlDocument);
} catch (XMLPlatformException e) {
throw XMLMarshalException.marshalException(e);
} catch (org.xml.sax.SAXNotRecognizedException e) {
//won't be thrown
} catch (SAXNotSupportedException e) {