protected void preTraverse(Node node)
    {
        if (node == null)
        {
            return;
        }

        if (node.type == Node.START_TAG || node.type == Node.START_END_TAG)
        {
            if (currIndex <= maxIndex && (tagName.equals("*") || tagName.equals(node.element)))
            {
                currIndex += 1;
                currNode = node;
            }
        }
        if (currIndex > maxIndex)
        {
            return;
        }

        node = node.content;
        while (node != null)
        {
            preTraverse(node);
            node = node.next;
        }
    }