code: def stringify(element, newlines=True):
      
  
      def attach_str(e, doc, answer):
          if hasattr(e, 'text'):
              ans = e.text
          elif isinstance(e, HorizontalSpaces):
              ans = ' '
          elif isinstance(e, VerticalSpaces) and newlines:
              ans = '\n\n'
          elif type(e) == Citation:
              ans = ''
          else:
              ans = ''
          answer.append(ans)
  
      answer = []
      f = partial(attach_str, answer=answer)
      element.walk(f)
      return ''.join(answer)
docs: Return the raw text version of an elements (and its children element).
  
      Example:
  
          >>> from panflute import *
          >>> e1 = Emph(Str('Hello'), Space, Str('world!'))
          >>> e2 = Strong(Str('Bye!'))
          >>> para = Para(e1, Space, e2)
          >>> stringify(para)
          'Hello world! Bye!\n\n'
  
      :param newlines: add a new line after a paragraph (default True)
      :type newlines: :class:`bool`
      :rtype: :class:`str`