nodes: 0, module; 1, function_definition; 2, function_name:dump_xml; 3, parameters; 4, block; 5, identifier:props; 6, identifier:fp; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, for_statement; 14, identifier:comment; 15, None; 16, identifier:encoding; 17, string; 18, identifier:sort_keys; 19, False; 20, comment:"""
      Write a series ``props`` of key-value pairs to a binary filehandle ``fp``
      in the format of an XML properties file.  The file will include both an XML
      declaration and a doctype declaration.
  
      :param props: A mapping or iterable of ``(key, value)`` pairs to write to
          ``fp``.  All keys and values in ``props`` must be text strings.  If
          ``sort_keys`` is `False`, the entries are output in iteration order.
      :param fp: a file-like object to write the values of ``props`` to
      :type fp: binary file-like object
      :param comment: if non-`None`, ``comment`` will be output as a
          ``<comment>`` element before the ``<entry>`` elements
      :type comment: text string or `None`
      :param string encoding: the name of the encoding to use for the XML
          document (also included in the XML declaration)
      :param bool sort_keys: if true, the elements of ``props`` are sorted
          lexicographically by key in the output
      :return: `None`
      """; 21, assignment; 22, call; 23, identifier:s; 24, call; 25, block; 26, string_content:UTF-8; 27, identifier:fp; 28, call; 29, identifier:print; 30, argument_list; 31, identifier:_stream_xml; 32, argument_list; 33, expression_statement; 34, attribute; 35, argument_list; 36, call; 37, keyword_argument; 38, identifier:props; 39, identifier:comment; 40, identifier:sort_keys; 41, call; 42, call; 43, identifier:streamwriter; 44, identifier:fp; 45, keyword_argument; 46, attribute; 47, argument_list; 48, identifier:file; 49, identifier:fp; 50, identifier:print; 51, argument_list; 52, attribute; 53, argument_list; 54, identifier:errors; 55, string; 56, string:'<?xml version="1.0" encoding={0} standalone="no"?>'; 57, identifier:format; 58, call; 59, identifier:s; 60, keyword_argument; 61, identifier:codecs; 62, identifier:lookup; 63, identifier:encoding; 64, string_content:xmlcharrefreplace; 65, identifier:quoteattr; 66, argument_list; 67, identifier:file; 68, identifier:fp; 69, identifier:encoding
code: def dump_xml(props, fp, comment=None, encoding='UTF-8', sort_keys=False):
      """
      Write a series ``props`` of key-value pairs to a binary filehandle ``fp``
      in the format of an XML properties file.  The file will include both an XML
      declaration and a doctype declaration.
  
      :param props: A mapping or iterable of ``(key, value)`` pairs to write to
          ``fp``.  All keys and values in ``props`` must be text strings.  If
          ``sort_keys`` is `False`, the entries are output in iteration order.
      :param fp: a file-like object to write the values of ``props`` to
      :type fp: binary file-like object
      :param comment: if non-`None`, ``comment`` will be output as a
          ``<comment>`` element before the ``<entry>`` elements
      :type comment: text string or `None`
      :param string encoding: the name of the encoding to use for the XML
          document (also included in the XML declaration)
      :param bool sort_keys: if true, the elements of ``props`` are sorted
          lexicographically by key in the output
      :return: `None`
      """
      fp = codecs.lookup(encoding).streamwriter(fp, errors='xmlcharrefreplace')
      print('<?xml version="1.0" encoding={0} standalone="no"?>'
            .format(quoteattr(encoding)), file=fp)
      for s in _stream_xml(props, comment, sort_keys):
          print(s, file=fp)