int (List content, int start) { if (start < 0) { start = 0; } int index = start; int size = content.size(); while (index < size) { Object node = content.get(index); if (!((node instanceof Text) || (node instanceof EntityRef))) { return index; } index++; } return size; }