Java tutorial
//package com.java2s; import org.w3c.dom.Text; public class Main { public static boolean isEmptyText(Text txt) { String s = txt.getData(); for (int i = 0; i < s.length(); ++i) { if (!Character.isWhitespace(s.charAt(i))) return false; } return true; } }