Here you can find the source of parseSpelling(Node spelling)
private static String parseSpelling(Node spelling)
//package com.java2s; /*/* w w w .j a v a2 s .c o m*/ * $Id$ * * Copyright 1998,1999,2000,2001 by Rockhopper Technologies, Inc., * 75 Trueman Ave., Haddonfield, New Jersey, 08033-2529, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of Rockhopper Technologies, Inc. ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with RTI. */ import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { private static String parseSpelling(Node spelling) { StringBuilder sb = new StringBuilder(); NodeList sc = spelling.getChildNodes(); int len = sc.getLength(); for (int i = 0; i < len; i++) { Node nn = sc.item(i); if (nn.getNodeName().equalsIgnoreCase("degree")) { sb.append(nn.getTextContent()); sb.append(' '); } } return sb.toString(); } }