// may be used to replace the substitution groups head, if required.
for (Iterator iter = substitutionGroups.values().iterator(); iter.hasNext(); ) {
SubstitutionGroup group = (SubstitutionGroup) iter.next();
XSElementImpl head = (XSElementImpl) group.getHead();
XsObject object = head.getXsObject();
XsESchema syntaxSchema = object.getXsESchema();
// Find a name for the group
String namespace = syntaxSchema.getTargetNamespace().toString();
String localName = head.getName().getLocalName() + "Group";
XsQName suggestion = new XsQName(namespace, localName);
if (pSchema.getGroup(suggestion) != null) {
for (int i = 0; ; i++) {
suggestion = new XsQName(namespace, localName + i);