XSParticle particle = particles.get(0);
XSTerm term = particle.getTerm();
if (term.getType() == XSConstants.MODEL_GROUP)
{
JBossXSModelGroup group = (JBossXSModelGroup)term;
XSObjectList list = group.getParticles();
ArrayList<XSParticle> baseParticles = new ArrayList<XSParticle>();
for (int i = 0; i < list.getLength(); i++)
baseParticles.add((XSParticle)list.item(i));
insertBaseParticle(baseParticles, name, type, targetNS);
if (baseParticles.size() > list.getLength())
group.setParticles(baseParticles);
}
else
{
particles.add(0, getXSParticle(name, type, targetNS));
}