List remove_list = new ArrayList(); for (int i = 0; i < list.size(); i++) { if (list.get(i) instanceof TextContent) { remove_list.add(list.get(i));
for (Iterator i = list.iterator(); i.hasNext();) { if (i.next() instanceof TextContent) { i.remove();
    private static void stripWhitespaceContent(List list) {        List remove_list = new ArrayList();        for (int i = 0; i < list.size(); i++) {            if (list.get(i) instanceof TextContent) {                remove_list.add(list.get(i));            }        }        for (int i = 0; i < remove_list.size(); i++) {            list.remove(remove_list.get(i));        }    }