'Move the cursor to the tag identified by sourceline and tags (a
list of tags names on the specified line). If attribute is specified
the cursor will be placed at the start of the attribute value.'

def goto_sourceline(self, editor, sourceline, tags, attribute=None):

    found_tag = False
    if (sourceline is None):
        return found_tag
    block = editor.document().findBlockByNumber((sourceline - 1))
    if (not block.isValid()):
        return found_tag
    c = editor.textCursor()
    ud = block.userData()
    all_tags = ([] if (ud is None) else [t for t in ud.tags if (t.is_start and (not t.closing))])
    tag_names = [t.name for t in all_tags]
    if (tag_names[:len(tags)] == tags):
        c.setPosition((block.position() + all_tags[(len(tags) - 1)].offset))
        found_tag = True
    else:
        c.setPosition(block.position())
    if (found_tag and (attribute is not None)):
        start_offset = (c.position() - block.position())
        (nblock, offset) = find_attribute_in_tag(block, start_offset, attribute)
        if (nblock is not None):
            c.setPosition((nblock.position() + offset))
    editor.setTextCursor(c)
    return found_tag
