'Return elements matching the given XPath.'

def xpath(self, element, path):

    try:
        xpath_result = element.xpath(path)
        if self._is_xml_unicode:
            return xpath_result
        result = []
        for item in xpath_result:
            if isinstance(item, str):
                item = unicode(item)
            result.append(item)
        return result
    except Exception as e:
        self._logger.error('%s:    caught    exception    extracting    XPath    "%s"', self._cname, path, exc_info=True)
        return []
