Here you can find the source of getName(Node node)
public static String getName(Node node)
//package com.java2s; import org.w3c.dom.*; public class Main { /** Gets the local (sans namespace) name of the given node. */ public static String getName(Node node) { // NB: The node.getLocalName() method does not work. String name = node.getNodeName(); int colon = name.lastIndexOf(":"); return colon < 0 ? name : name.substring(colon + 1); }//from w ww .j a v a 2 s .com }