def GetXml(self, indent_num=0, xml_doc=True):
    if not hasattr(self, '_plist'):  # no plist is parsed.
      if xml_doc and getattr(self, '_plist_xml', None):
        # A full XML document was requested and unparsed XML is set, return it.
        return self._plist_xml
      elif getattr(self, '_plist_xml', None):
        # Only the XML contents were requested, so parse the unparsed XML, which
        # creates the _plist property for regular use below.
        try:
          self.Parse()
        except PlistError:
          self._plist = None
      else:
        # self._plist_xml is unset or None, so the plist is considered empty.
        self._plist = None

    if type(self._plist) not in PLIST_CONTENT_TYPES:
      raise PlistError(
          'Plist contents type is not supported: %s' % type(self._plist))

    # workaround for empty plists, don't try to decode the None
    # value because of how GetXmlStr() handles them.  at this GetXml()
    # level we know None means NO (0) values, not ONE (1) None value.
    if self._plist is None:
      str_xml = ''
    else:
      # indent +1 from <plist> node if xml_doc
      str_xml = GetXmlStr(self._plist, indent_num=indent_num + (xml_doc * 1))

    if xml_doc:
      return ''.join([PLIST_HEAD, str_xml, PLIST_FOOT])
    else:
      return str_xml
Emit a message to a single client, a room, or all the clients
dataset/ETHPy150Open google/simian/src/simian/mac/munki/plist.py/ApplePlist.GetXml--crossover with--dataset/ETHPy150Open miguelgrinberg/python-socketio/socketio/pubsub_manager.py/PubSubManager.emit