XMLRoot root = new XMLRoot();
root.setObject(object);
root.setLocalName(name);
XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
Document doc = xmlPlatform.createDocument();
marshaller.marshal(root, doc);
return xmlPlatform.validate(doc.getDocumentElement(), descriptor, getErrorHandler());
} catch (XMLPlatformException e) {
throw XMLMarshalException.validateException(e);
}