Parse XML data reading from the object file. file only needs to provide the read(nbytes) method, which returns bytes, and an empty bytes object when there’s no more data. Text files are not supported; use Parse() for data which is already decoded.
xml.parsers.expat/xmlparser.ParseFile
xmlparser.ParseFile