def METHOD_NAME(self, r, d):
    if isinstance(d, dict):
        for k, v in d.items():
            s = SE(r, k)
            self.METHOD_NAME(s, v)
    elif isinstance(d, (tuple, list)):
        for v in d:
            s = SE(r, 'i')
            self.METHOD_NAME(s, v)
    else:
        r.text = str(d)
    return r