def EncodeXml(self, encoding=None):
    if not encoding:
      encoding = self.GetEncoding()

    if encoding and type(self._plist_xml) is not unicode:
      try:
        self._plist_xml = unicode(self._plist_xml, encoding)
      except LookupError:
        raise InvalidPlistError('Encoding not valid: %s' % encoding)
Encodes the plist xml to a particular encoding.
dataset/ETHPy150Open google/simian/src/simian/mac/munki/plist.py/ApplePlist.EncodeXml