Here you can find the source of getChildNodeTextContent(Node parentNode, String childElementName)
public static String getChildNodeTextContent(Node parentNode, String childElementName)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getChildNodeTextContent(Node parentNode, String childElementName) { Node node = getChildNode(parentNode, childElementName); if (node != null) return node.getTextContent(); return null; }/*from w ww.java 2 s. com*/ public static Node getChildNode(Node parentNode, String childElementName) { NodeList l = parentNode.getChildNodes(); for (int i = 0; i < l.getLength(); i++) { Node node = l.item(i); if (node.getNodeName().equals(childElementName)) return node; } return null; } }