while (iterator.hasNext()) {
dataType = (Type)iterator.next();
schemaBuilder.buildSchema(dataType);
}
XSDSchema xmlSchema = null;
iterator = schemaMap.values().iterator();
StringWriter writer = new StringWriter();
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
while (iterator.hasNext()) {
xmlSchema = (XSDSchema)iterator.next();
if (xmlSchema.getElement() == null) {
xmlSchema.updateElement();
}
transformer.transform(new DOMSource(xmlSchema.getElement().getOwnerDocument()),
new StreamResult(writer));
}
writer.close();
return writer.getBuffer().toString();
} catch (Exception e) {