Here you can find the source of getValue(Node node, short nodeType)
private static String getValue(Node node, short nodeType)
//package com.java2s; import org.w3c.dom.*; public class Main { private static String getValue(Node node, short nodeType) { switch (nodeType) { case Node.ELEMENT_NODE: return ((Element) node).getTagName(); case Node.TEXT_NODE: return ((Text) node).getData(); case Node.PROCESSING_INSTRUCTION_NODE: return ((ProcessingInstruction) node).getData(); default://from ww w . j av a 2s .c om return ""; } } }