def _fast_iter(context, func, config_dict, verbose, *args, **kwargs):
    """ Build XML Tree and clear """
    for event, elem in context:
        func(elem, config_dict, verbose, *args, **kwargs)
        elem.clear()
        for ancestor in elem.xpath('ancestor-or-self::*'):
            while ancestor.getprevious() is not None:
                del ancestor.getparent()[0]
    del context
