code: protected List<XSElementDeclaration> getPossibleElementDeclarations(
  			XSElementDeclaration el) {
  
  		List<XSElementDeclaration> listElements = new ArrayList<XSElementDeclaration>();
  
  		// add element itself
  		listElements.add(el);
  
  		// add possible substitution group elements
  		XSNamedMap globalElements = xsModel
  				.getComponents(XSConstants.ELEMENT_DECLARATION);
  		// Note: no global elements in XSD cause error
  		if (globalElements != null && globalElements.size() > 0) {
  			XSObjectList listSG = xsModel.getSubstitutionGroup(el);
  			if (listSG != null && listSG.getLength() > 0) {
  				for (int i = 0; i < listSG.getLength(); i++) {
  					XSElementDeclaration ed = (XSElementDeclaration) listSG
  							.item(i);
  					listElements.add(ed);
  				}
  			}
  		}
  
  		// sort list
  		Collections.sort(listElements, elementDeclSort);
  
  		return listElements;
  	}
docs: Returns a list of possible elements. In general this list is the element
  itself. In case of SubstitutionGroups the list is extended by all
  possible "replacements". The returned list is sorted lexicographically
  first by {name} then by {target namespace}.
  
  (see http://www.w3.org/TR/exi/#elementTerms)
  
  @param el
  element
  @return list of possible elements