def XmlToString(content, encoding='utf-8', pretty=False):
  # We create a huge list of all the elements of the file.
  xml_parts = ['<?xml version="1.0" encoding="%s"?>' % encoding]
  if pretty:
    xml_parts.append('\n')
  _ConstructContentList(xml_parts, content, pretty)

  # Convert it to a string
  return ''.join(xml_parts)
Writes the XML content to disk, touching the file only if it has changed.
dataset/ETHPy150Open adblockplus/gyp/pylib/gyp/easy_xml.py/XmlToString