'Returns the string representation of the specified element.
The element to convert to a string is specified using ``source`` and
``xpath``. They have exactly the same semantics as with `Get Element`
keyword.
By default the string is returned as Unicode. If ``encoding`` argument
is given any value, the string is returned as bytes in the specified
encoding. The resulting string never contains the XML declaration.
See also `Log Element` and `Save XML`.'

def element_to_string(self, source, xpath='.', encoding=None):

    source = self.get_element(source, xpath)
    string = self.etree.tostring(source, encoding='UTF-8').decode('UTF-8')
    string = self._xml_declaration.sub('', string).strip()
    if encoding:
        string = string.encode(encoding)
    return string
