Java tutorial
//package com.java2s; import org.w3c.dom.Node; public class Main { /** * Extracts a String from a Document consisting entirely of a String. * * @return the String */ public static String extractString(Node d) { if (d == null) { return null; } return d.getFirstChild().getTextContent(); } }