def text(self, cls='current', retaintokenisation=False):
        """Returns the text of the entire document (returns a unicode instance)

        See also:
            :meth:`AbstractElement.text`
        """

        #backward compatibility, old versions didn't have cls as first argument, so if a boolean is passed first we interpret it as the 2nd:
        if cls is True or cls is False:
            retaintokenisation = cls
            cls = 'current'

        s = ""
        for c in self.data:
            if s: s += "\n\n\n"
            try:
                s += c.text(cls, retaintokenisation)
            except NoSuchText:
                continue
        return s
Returns the text of the entire document (returns a unicode instance)

        See also:
            :meth:`AbstractElement.text`