public boolean matches(NodeInfo node) {
if (node.getNodeKind() != Type.DOCUMENT) {
return false;
}
AxisIterator iter = node.iterateAxis(Axis.CHILD);
// The match is true if there is exactly one element node child, no text node
// children, and the element node matches the element test.
boolean found = false;
while (true) {
NodeInfo n = (NodeInfo)iter.next();
if (n==null) {
return found;
}
int kind = n.getNodeKind();
if (kind==Type.TEXT) {