def _attribToString(attrib):
    """
    convert attrib dictionnary to string suitable for XPath search

    {'name': 'Reacher', 'date': '2016', 'type': 'Movie'}
    [contains(@name, "Reacher") and contains(@type, "Movie")]
    """

    s = "["

    lFirst = True

    for k in attrib:
        if lFirst:
            s = s + "contains(@" + k + ', "' + attrib[k] + '")'
            lFirst = False
        else:
            s = s + " and contains(@" + k + ', "' + attrib[k] + '")'

    s = s + "]"

    return s