public static void getText(Node node, StringBuilder sb) {
		NodeList children = node.getChildNodes();
		for (int i = 0; i < children.getLength(); i++) {
			Node child = children.item(i);
			if (child.getNodeType() == Node.TEXT_NODE) {
				sb.append(' '); // BUG: this is a hack
				sb.append(child.getNodeValue().trim());
			} else if (child.getNodeType() == Node.ELEMENT_NODE) {
				getText(child, sb);
			}
		}
	}
public static void getText(Node node, StringBuilder sb) {
		NodeList children = node.getChildNodes();
		for (int i = 0; i < children.getLength(); i++) {
			Node child = children.item(i);
			if (child.getNodeType() == Node.TEXT_NODE) {
				sb.append(' ');
				sb.append(child.getNodeValue().trim());
			} else if (child.getNodeType() == Node.ELEMENT_NODE) {
				getText(child, sb);
			}
		}
	}
public static void gettext(node node, stringbuilder sb) { nodelist children = node.getchildnodes(); for (int i = 0; i < children.getlength(); i++) { node child = children.item(i); if (child.getnodetype() == node.text_node) { sb.append(' '); sb.append(child.getnodevalue().trim()); } else if (child.getnodetype() == node.element_node) { gettext(child, sb); } } }