public static boolean ignoreElementWithAttributeValue(
            StartElement startElement, String nameOfElement,
            String nameOfAttribute, String[] attributeValues) {

        String tagName = startElement.getName().getLocalPart();
        boolean found = true;
        if (tagName.equals(nameOfElement)) {
            Attribute att = startElement.getAttributeByName(new QName(nameOfAttribute));
            if (found) {
                for (String tagToGet : attributeValues) {
                    if (att != null && att.getValue().equalsIgnoreCase(tagToGet)) {
                        found = false;
                        break;
                    }
                }
            }
        }

        return found;
    }