Here you can find the source of matches(QName qname, Node node)
public static boolean matches(QName qname, Node node)
//package com.java2s; import javax.xml.namespace.*; import org.w3c.dom.*; public class Main { public static boolean matches(QName qname, Node node) { return (node != null && qname.equals(newQName(node))); }//from ww w . j a v a2s . c o m public static QName newQName(Node node) { if (node != null) { return new QName(node.getNamespaceURI(), node.getLocalName()); } else { return new QName(null, null); } } }