void (Element element, final String[] filters, final String tagName) { if (filters != null) { for (String filter : filters) { final Element filterElement = new Element(tagName); filterElement.setText(filter); element.addContent(filterElement); } } }