int count = 0;
int index = 0;
Structure structure = element.getParent();
if (structure instanceof ContentModelGroup) {
ContentModelGroup cmg = (ContentModelGroup)structure;
Enumeration enumeration = cmg.enumerate();
while (enumeration.hasMoreElements()) {
Structure tmpStruct = (Structure)enumeration.nextElement();
if (tmpStruct.getStructureType() == Structure.ELEMENT) {
ElementDecl tmpDecl = (ElementDecl)tmpStruct;
if (tmpDecl.isReference()) {