/** * Creates an XMLDocument with the specified XML rootElement for the DataObject. * * @param dataObject specifies DataObject to be saved * @param rootElementURI the Target Namespace URI of the root XML element * @param rootElementName the Name of the root XML element * @return XMLDocument a new XMLDocument set with the specified parameters. */ public XMLDocument createDocument( DataObject dataObject, String rootElementURI, String rootElementName) { SDOXMLDocument document = new SDOXMLDocument(); document.setRootObject(dataObject); document.setRootElementURI(rootElementURI); if (rootElementName != null) { document.setRootElementName(rootElementName); } Property globalProp = getHelperContext().getXSDHelper().getGlobalProperty(rootElementURI, rootElementName, true); if (null != globalProp) { document.setSchemaType(((SDOType) globalProp.getType()).getXsdType()); } document.setEncoding(SDOXMLDocument.DEFAULT_XML_ENCODING); document.setXMLVersion(SDOXMLDocument.DEFAULT_XML_VERSION); return document; }