parameters: (content, path, encoding="utf-8", pretty=False, win32=False)
docstring: Writes the XML content to disk, touching the file only if it has changed.
  
    Args:
      content:  The structured content to be written.
      path: Location of the file.
      encoding: The encoding to report on the first line of the XML file.
      pretty: True if we want pretty printing with indents and new lines.
docstring_summary: Writes the XML content to disk, touching the file only if it has changed.
docstring_tokens: Writes the XML content to disk touching the file only if it has changed .
function: def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False, win32=False):
      """ Writes the XML content to disk, touching the file only if it has changed.
  
    Args:
      content:  The structured content to be written.
      path: Location of the file.
      encoding: The encoding to report on the first line of the XML file.
      pretty: True if we want pretty printing with indents and new lines.
    """
      xml_string = XmlToString(content, encoding, pretty)
      if win32 and os.linesep != "\r\n":
          xml_string = xml_string.replace("\n", "\r\n")
  
      default_encoding = locale.getdefaultlocale()[1]
      if default_encoding and default_encoding.upper() != encoding.upper():
          xml_string = xml_string.encode(encoding)
  
      # Get the old content
      try:
          with open(path, "r") as file:
              existing = file.read()
      except IOError:
          existing = None
  
      # It has changed, write it
      if existing != xml_string:
          with open(path, "wb") as file:
              file.write(xml_string)
function_tokens: def WriteXmlIfChanged ( content , path , encoding = "utf-8" , pretty = False , win32 = False ) : xml_string = XmlToString ( content , encoding , pretty ) if win32 and os . linesep != "\r\n" : xml_string = xml_string . replace ( "\n" , "\r\n" ) default_encoding = locale . getdefaultlocale ( ) [ 1 ] if default_encoding and default_encoding . upper ( ) != encoding . upper ( ) : xml_string = xml_string . encode ( encoding ) # Get the old content try : with open ( path , "r" ) as file : existing = file . read ( ) except IOError : existing = None # It has changed, write it if existing != xml_string : with open ( path , "wb" ) as file : file . write ( xml_string )