def template_to_dict_iter_debug(elm):
    """
    Print expanded element on stdout for debugging
    """
    if elm.text is not None:
        print('    <%s>%s</%s>' % (elm.tag, elm.text, elm.tag), end='')
        if elm.tail is not None:
            print(elm.tail)
        else:
            print()
    elif elm.tail is not None:
        print('    <%s>%s' % (elm.tag, elm.tail))
    else:
        print('    <%s>' % elm.tag)
