public boolean isEmpty() {
        if (!isPruned()) {
            for (Object child : this.children) {
                if (child instanceof TagNode) {
                    if (!((TagNode) child).isPruned()) {
                        return false;
                    }
                } else if (child instanceof ContentNode) {
                    if (!((ContentNode) child).isBlank()) {
                        return false;
                    }
                } else if (child instanceof CommentNode) {
                    // ideally could be discarded - however standard practice is to include browser specific commands in comments. :-(
                    return false;
                } else {
                    return false;
                }
            }
        }
        return true;
    }