private void addChildElement(Element seq, ComponentDefinition childDef, ComponentDefinition parentDef,
Cardinality card) {
if (childDef.getTag().startsWith("#")) {
return;
}
if (childDef != null && !childDef.isParentTag(parentDef.getTag())) {
return;
}
Element child = createElement("element", seq, "ref", childDef.getTag());
child.setAttribute("minOccurs", Integer.toString(card.getMinimum()));
if (card.hasMaximum()) {
child.setAttribute("maxOccurs", Integer.toString(card.getMaximum()));
} else {
child.setAttribute("maxOccurs", "unbounded");
}
}