XSModelGroupDefinition groupDef = (XSModelGroupDefinition)groups.item(i);
XSModelGroup group = groupDef.getModelGroup();
XSObjectList particles = group.getParticles();
for(int j = 0; j < particles.getLength(); ++j)
{
XSParticle particle = (XSParticle)particles.item(j);
XSTerm term = particle.getTerm();
switch(term.getType())
{
case XSConstants.ELEMENT_DECLARATION:
XSElementDeclaration element = ((XSElementDeclaration)term);
sharedElements.add(element);