private TagNode findElement(ITagNodeCondition condition, boolean isRecursive) {
        if (condition != null) {
            for (Object item : children) {
                if (item instanceof TagNode) {
                    TagNode currNode = (TagNode) item;
                    if (condition.satisfy(currNode)) {
                        return currNode;
                    } else if (isRecursive) {
                        TagNode inner = currNode.findElement(condition, isRecursive);
                        if (inner != null) {
                            return inner;
                        }
                    }
                }
            }
        }
        return null;
    }