void (Element parentElement, Collection<? super String> collection, String collectionName, String itemName) { Element child = parentElement.getChild(getTagName()); if (child != null) { collection.clear(); Element item = child.getChild(collectionName); if (item != null) { for (Element element : item.getChildren(itemName)) { collection.add(element.getAttributeValue(COLLECTION_ITEM_ATTRIBUTE)); } } } }