code: def paula_etree_to_string(tree, dtd_filename):
      
      return etree.tostring(
          tree, pretty_print=True, xml_declaration=True,
          encoding="UTF-8", standalone='no',
          doctype='<!DOCTYPE paula SYSTEM "{0}">'.format(dtd_filename))
docs: convert a PAULA etree into an XML string.