n = 3
d = {'0': ['a.root', 'b.root', 0]}
for i in range(n):
    d[str(i + 1)] = [d[str(i)][0] + '[' + chr(105 + i) + ']', d[str(i)][1] +
        '[' + chr(105 + i) + ']', i + 1]
print(d)

def compare(points=d['0'], passNo=0):
    if xml.xml_compare(eval(points[0]), eval(points[1])) == False:
        exec ('for' + str(chr(points[2] + 105)) + 'in enumerate(' + str(
            points[0]) + '): compare(' + str(d[str(passNo + 1)][0]) + ', ' +
            str(d[str(passNo + 1)][1]) + ')')
compare()
Python - abstracting a recursion to all nth level recursion (lxml)