'Evaluates the given xpath expression and returns results.
The element in which context the expression is executed is specified
using ``source`` and ``context`` arguments. They have exactly the same
semantics as ``source`` and ``xpath`` arguments have with `Get Element`
keyword.
The xpath expression to evaluate is given as ``expression`` argument.
The result of the evaluation is returned as-is.
Examples using ``${XML}`` structure from `Example`:
| ${count} =      | Evaluate Xpath | ${XML}  | count(third/*) |
| Should Be Equal | ${count}       | ${3}    |
| ${text} =       | Evaluate Xpath | ${XML}  | string(descendant::second[last()]/@id) |
| Should Be Equal | ${text}        | child   |
| ${bold} =       | Evaluate Xpath | ${XML}  | boolean(preceding-sibling::*[1] = \'bold\') | context=html/p/i |
| Should Be Equal | ${bold}        | ${True} |
This keyword works only if lxml mode is taken into use when `importing`
the library. New in Robot Framework 2.8.5.'

def evaluate_xpath(self, source, expression, context='.'):

    if (not self.lxml_etree):
        raise RuntimeError("'Evaluate    Xpath'    keyword    only    works    in    lxml    mode.")
    return self.get_element(source, context).xpath(expression)
