I would like to iterate through an XML structure. My code does seem to work. I checked the debugger and saw that it reached the return, but the for loop continues.
Looking forward to your advice, thank you!
def get_value(root, item):
for node in root:
if node.tag == item:
return node.tag
else:
get_value(node, item)
return 'Item not found in XML'