// need a deep-copy clone of oxProject; simplest way is to marshall/unmarshall to a stream
StringWriter sw = new StringWriter();
XMLProjectWriter.write(oxProject, sw);
XRDynamicClassLoader specialLoader =
new XRDynamicClassLoader(this.getClass().getClassLoader());
Project oxProjectClone = XMLProjectReader.read(new StringReader(sw.toString()), specialLoader);
ProjectHelper.fixOROXAccessors(oxProjectClone, null);
XMLLogin xmlLogin = new XMLLogin();
DOMPlatform domPlatform = new DOMPlatform();
domPlatform.getConversionManager().setLoader(specialLoader);
xmlLogin.setPlatform(domPlatform);
oxProjectClone.setLogin(xmlLogin);
oxProjectClone.createDatabaseSession(); // initialize reference descriptors
SchemaModelGenerator schemaGenerator = new SchemaModelGenerator(true);
SchemaModelGeneratorProperties sgProperties = new SchemaModelGeneratorProperties();
// set element form default to qualified for target namespace
sgProperties.addProperty(getTargetNamespace(), ELEMENT_FORM_QUALIFIED_KEY, true);
Map<String, Schema> schemaMap = schemaGenerator.generateSchemas(descriptorsToProcess, sgProperties);