def load_xml_generator_configuration(configuration, **defaults):
parser = configuration<EOL>if utils.is_str(configuration):<EOL><INDENT>parser = ConfigParser()<EOL>parser.read(configuration)<EOL><DEDENT>cfg = xml_generator_configuration_t()<EOL>values = defaults<EOL>if not values:<EOL><INDENT>values = {}<EOL><DEDENT>if parser.has_section('<STR_LIT>'):<EOL><INDENT>for name, value in parser.items('<STR_LIT>'):<EOL><INDENT>if value.strip():<EOL><INDENT>values[name] = value<EOL><DEDENT><DEDENT><DEDENT>for name, value in values.items():<EOL><INDENT>if isinstance(value, str):<EOL><INDENT>value = value.strip()<EOL><DEDENT>if name == '<STR_LIT>':<EOL><INDENT>cfg.gccxml_path = value<EOL><DEDENT>if name == '<STR_LIT>':<EOL><INDENT>cfg.xml_generator_path = value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>cfg.working_directory = value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>for p in value.split('<STR_LIT:;>'):<EOL><INDENT>p = p.strip()<EOL>if p:<EOL><INDENT>cfg.include_paths.append(os.path.normpath(p))<EOL><DEDENT><DEDENT><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>cfg.compiler = value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>cfg.xml_generator = value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>cfg.castxml_epic_version = int(value)<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>cfg.keep_xml = value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>cfg.cflags = value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>cfg.flags = value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>cfg.compiler_path = value<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>' % name)<EOL><DEDENT><DEDENT>cfg.compiler_path = create_compiler_path(<EOL>cfg.xml_generator, cfg.compiler_path)<EOL>return cfg<EOL>
Loads CastXML or GCC-XML configuration.

Args:
     configuration (string|configparser.ConfigParser): can be
         a string (file path to a configuration file) or
         instance of :class:`configparser.ConfigParser`.
     defaults: can be used to override single configuration values.

Returns:
    :class:`.xml_generator_configuration_t`: a configuration object


The file passed needs to be in a format that can be parsed by
:class:`configparser.ConfigParser`.

An example configuration file skeleton can be found
`here <https://github.com/gccxml/pygccxml/blob/develop/
unittests/xml_generator.cfg>`_.