Java tutorial
//package com.java2s; import org.w3c.dom.Node; import java.util.Collection; public class Main { private static boolean nodeNameMatch(Node node, Collection<?> desiredNames) { return (desiredNames.contains(node.getNodeName()) || desiredNames.contains(node.getLocalName())); } private static boolean nodeNameMatch(Node node, String desiredName) { return (desiredName.equals(node.getNodeName()) || desiredName.equals(node.getLocalName())); } }