//select all the elements. We generate the code for types
//only if the elements refer them!!! regardless of the fact that
//we have a list of elementnames, we'll need to process all the elements
XmlSchemaObjectTable elements = schema.getElements();
Iterator xmlSchemaElement1Iterator = elements.getValues();
while (xmlSchemaElement1Iterator.hasNext()) {
//this is the set of outer elements so we need to generate classes
//The outermost elements do not contain occurence counts (!) so we do not need
//to check for arraytypes
processElement((XmlSchemaElement) xmlSchemaElement1Iterator.next(), schema);
}
Iterator xmlSchemaElement2Iterator = elements.getValues();
// re-iterate through the elements and write them one by one
// if the mode is unwrap this process will not really write the
// classes but will accumilate the models for a final single shot
// write