valid xmland using elementtree allows us to extract data from xml without worrying about the rules of xml syntax looping through nodes often the xml has multiple nodes and we need to write loop to process all of the nodes in the following programwe loop through all of the user nodesimport xml etree elementtree as et input '' chuck brent ''stuff et fromstring(inputlst stuff findall('users/user'print('user count:'len(lst)for item in lstprint('name'item find('name'textprint('id'item find('id'textprint('attribute'item get(' ')codethe findall method retrieves python list of subtrees that represent the user structures in the xml tree then we can write for loop that looks at each of the user nodesand prints the name and id text elements as well as the attribute from the user node user count name chuck id attribute name brent id attribute