code: def to_xml(body_element):
      
      doctype = b"""<?xml version="1.0" encoding="UTF-8"?>\n"""
      if body_element is None:
          return succeed(b"")
      d = flattenString(None, body_element)
      d.addCallback(lambda flattened: doctype + flattened)
      return d
docs: Serialize a L{twisted.web.template.Tag} to a UTF-8 encoded XML document
      with an XML doctype header.