def load_xml_generator_configuration(configuration, **defaults):
    """
    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>`_.

    """
    parser = configuration
    if utils.is_str(configuration):
        parser = ConfigParser()
        parser.read(configuration)

    # Create a new empty configuration
    cfg = xml_generator_configuration_t()

    values = defaults
    if not values:
        values = {}

    if parser.has_section('xml_generator'):
        for name, value in parser.items('xml_generator'):
            if value.strip():
                values[name] = value

    for name, value in values.items():
        if isinstance(value, str):
            value = value.strip()
        if name == 'gccxml_path':
            cfg.gccxml_path = value
        if name == 'xml_generator_path':
            cfg.xml_generator_path = value
        elif name == 'working_directory':
            cfg.working_directory = value
        elif name == 'include_paths':
            for p in value.split(';'):
                p = p.strip()
                if p:
                    cfg.include_paths.append(os.path.normpath(p))
        elif name == 'compiler':
            cfg.compiler = value
        elif name == 'xml_generator':
            cfg.xml_generator = value
        elif name == 'castxml_epic_version':
            cfg.castxml_epic_version = int(value)
        elif name == 'keep_xml':
            cfg.keep_xml = value
        elif name == 'cflags':
            cfg.cflags = value
        elif name == 'flags':
            cfg.flags = value
        elif name == 'compiler_path':
            cfg.compiler_path = value
        else:
            print('\n%s entry was ignored' % name)

    # If no compiler path was set and we are using castxml, set the path
    # Here we overwrite the default configuration done in the cfg because
    # the xml_generator was set through the setter after the creation of a new
    # emppty configuration object.
    cfg.compiler_path = create_compiler_path(
        cfg.xml_generator, cfg.compiler_path)

    return cfg
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>`_.