def selectImpl(self, cond, multiple, root, maxDepth, onlyVisibleNode, includeRoot):
result = []<EOL>if not root:<EOL><INDENT>return result<EOL><DEDENT>op, args = cond<EOL>if op in ('<STR_LIT:>>', '<STR_LIT:/>'):<EOL><INDENT>parents = [root]<EOL>for index, arg in enumerate(args):<EOL><INDENT>midResult = []<EOL>for parent in parents:<EOL><INDENT>if op == '<STR_LIT:/>' and index != <NUM_LIT:0>:<EOL><INDENT>_maxDepth = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>_maxDepth = maxDepth<EOL><DEDENT>_res = self.selectImpl(arg, True, parent, _maxDepth, onlyVisibleNode, False)<EOL>[midResult.append(r) for r in _res if r not in midResult]<EOL><DEDENT>parents = midResult<EOL><DEDENT>result = parents<EOL><DEDENT>elif op == '<STR_LIT:->':<EOL><INDENT>query1, query2 = args<EOL>result1 = self.selectImpl(query1, multiple, root, maxDepth, onlyVisibleNode, includeRoot)<EOL>for n in result1:<EOL><INDENT>sibling_result = self.selectImpl(query2, multiple, n.getParent(), <NUM_LIT:1>, onlyVisibleNode, includeRoot)<EOL>[result.append(r) for r in sibling_result if r not in result]<EOL><DEDENT><DEDENT>elif op == '<STR_LIT:index>':<EOL><INDENT>cond, i = args<EOL>try:<EOL><INDENT>result = [self.selectImpl(cond, multiple, root, maxDepth, onlyVisibleNode, includeRoot)[i]]<EOL><DEDENT>except IndexError:<EOL><INDENT>raise NoSuchTargetException(<EOL>u'<STR_LIT>'.format(i, cond, root))<EOL><DEDENT><DEDENT>elif op == '<STR_LIT>':<EOL><INDENT>query1, _ = args<EOL>result1 = self.selectImpl(query1, False, root, maxDepth, onlyVisibleNode, includeRoot)<EOL>if result1:<EOL><INDENT>parent_node = result1[<NUM_LIT:0>].getParent()<EOL>if parent_node is not None:<EOL><INDENT>result = [parent_node]<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>self._selectTraverse(cond, root, result, multiple, maxDepth, onlyVisibleNode, includeRoot)<EOL><DEDENT>return result<EOL>
Selector internal implementation. 
TODO: add later.

.. note:: This doc shows only the outline of the algorithm. Do not call this method in your code as this
 is an internal method.

Args:
    cond (:obj:`tuple`): query expression
    multiple (:obj:`bool`): whether or not to select multiple nodes. If true, all nodes that matches the given
     condition will return, otherwise, only the first node matches will.
    root (inherited from :py:class:`AbstractNode <poco.sdk.AbstractNode>`): start traversing from the given
     root node
    maxDepth (:obj:`bool`): max traversing depth
    onlyVisibleNode (:obj:`bool`): If True, skip those node which visibility (the value of visible attribute) is
     False.
    includeRoot (:obj:`bool`): whether not not to include the root node if its child(ren) match(es) the node

Returns:
    :obj:`list` <inherited from :py:class:`AbstractNode <poco.sdk.AbstractNode>`>: The same as
     :py:meth:`select <poco.sdk.Selector.ISelector.select>`.