fromstring
function is for reading xml data from string.
For reading xml data from file you should use parse
. See docs on parsing xml with elementtree.
import xml.etree.ElementTree as ET
tree = ET.parse("C:\DATA\US_Patent_Data\2012\ipgb20120103_wk01\ipgb20120103.xml")
root = tree.getroot()
UPD: Seems like your xml is not well-formed because it has multiple roots. Try adding a single root element:
with open('ipgb20120103.xml', 'r') as f:
xml_string = "<root>%s</root>" % f.read()
root = ET.fromstring(xml_string)