/**
	 * <p>Constructs the textual content of the given node and
	 * recursively the textual content of its sub element nodes.
	 * Appends the result to the given StringBuilder.</p>
	 * 
	 * @param node XML node
	 * @param sb StringBuilder that will contain the textual content of the node
	 */
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(' '); // 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(' '); // 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(' '); // BUG: this is a hack
sb.append(child.getNodeValue().trim());
} else if (child.getNodeType() == Node.ELEMENT_NODE) {
getText(child, sb);
}
}
}