Object (final DomInvocationHandler handler, final Object[] args) { Map<XmlTag,DomElement> map = new HashMap<>(); for (final CollectionChildDescriptionImpl qname : myQnames) { for (DomElement element : handler.getCollectionChildren(qname)) { map.put(element.getXmlTag(), element); } } final XmlTag tag = handler.getXmlTag(); if (tag == null) return Collections.emptyList(); final List<DomElement> list = new ArrayList<>(); for (final XmlTag subTag : tag.getSubTags()) { ContainerUtil.addIfNotNull(list, map.get(subTag)); } return list; }