code: def template_to_dict_iter(item, debug=0):
      
      valarr = []
      found_template = False
  
      if debug > 1:
          print("template_to_dict_iter:")
  
      for elm in item.iter():
  
          if debug > 1:
              template_to_dict_iter_debug(elm)
  
          if elm.tag == 'value' and not found_template:
              valarr.append(elm.text.strip())
  
          if elm.tag == 'template':
              found_template = True
              valarr.append(template_to_text(elm, debug).strip())
  
          if elm.tail:
              valarr.append(elm.tail.strip())
  
      value = " ".join([x for x in valarr if x])
  
      if debug:
          print("  iter: %s" % value)
  
      return value
docs: Returns infobox parsetree value using etree.iter()
  
      Preferred template_to_dict() algorithm, uses etree.iter() to
      iterate over elements, accumulating tail text in order, but not
      preserving `<ext>` tags (references, etc.). The advantage is that
      it picks up MORE templates and links that may be mixed in with
      `<ext>` tags, and keeps the result focused on the data. Compare to
      template_to_dict_find().