EjbReferenceNode subNode = new EjbReferenceNode();
// ejb-ref*
Set localRefDescs = new HashSet();
for (;refs.hasNext();) {
EjbReference ejbRef = (EjbReference) refs.next();
if (ejbRef.isLocal()) {
localRefDescs.add(ejbRef);
} else {
subNode.writeDescriptor(parentNode, TagNames.EJB_REFERENCE, ejbRef);
}
}
// ejb-local-ref*
for (Iterator e=localRefDescs.iterator(); e.hasNext();) {
EjbReference ejbRef = (EjbReference) e.next();
subNode.writeDescriptor(parentNode, TagNames.EJB_LOCAL_REFERENCE,ejbRef);
}
}