Here you can find the source of hasChildElement(TreeWalker walker)
public static boolean hasChildElement(TreeWalker walker)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Node; import org.w3c.dom.traversal.TreeWalker; public class Main { public static boolean hasChildElement(TreeWalker walker) { Node current = walker.getCurrentNode(); Node child = walker.firstChild(); if (child != null) { walker.setCurrentNode(current); return true; }/*from ww w. j a v a 2s . co m*/ return false; } }