I am using ElementTree to get the attributes and elements I need from an xml file. The xml file is queried from mySQL I want to write out all the attributes and elements into a new text file using python
root = tree.getroot()
name = root.attrib['name']
country = root.find("country").text
I can see the results when I print them out I want to write to a file the list of all the names and countries in the xml file