tostring () is actually a function of the ElementTree module, not a method of the ElementTree wrapper class.
>>> import xml.etree.ElementTree as ET >>> x = ET.fromstring('<xml><one>one</one></xml>') >>> x <Element xml at 7f749572f710> >>> ET.tostring(x) '<xml><one>one</one></xml>'
source share