'Returns all text of the element, possibly whitespace normalized.
The element whose text to return is specified using ``source`` and
``xpath``. They have exactly the same semantics as with `Get Element`
keyword.
This keyword returns all the text of the specified element, including
all the text its children and grandchildren contain. If the element
has no text, an empty string is returned. The returned text is thus not
always the same as the `text` attribute of the element.
By default all whitespace, including newlines and indentation, inside
the element is returned as-is. If ``normalize_whitespace`` is given
a true value (see `Boolean arguments`), then leading and trailing
whitespace is stripped, newlines and tabs converted to spaces, and
multiple spaces collapsed into one. This is especially useful when
dealing with HTML data.
Examples using ``${XML}`` structure from `Example`:
| ${text} =       | Get Element Text | ${XML}       | first        |
| Should Be Equal | ${text}          | text         |              |
| ${text} =       | Get Element Text | ${XML}       | second/child |
| Should Be Empty | ${text}          |              |              |
| ${paragraph} =  | Get Element      | ${XML}       | html/p       |
| ${text} =       | Get Element Text | ${paragraph} | normalize_whitespace=yes |
| Should Be Equal | ${text}          | Text with bold and italics. |
See also `Get Elements Texts`, `Element Text Should Be` and
`Element Text Should Match`.'

def get_element_text(self, source, xpath='.', normalize_whitespace=False):

    element = self.get_element(source, xpath)
    text = ''.join(self._yield_texts(element))
    if is_truthy(normalize_whitespace):
        text = self._normalize_whitespace(text)
    return text
