Elementtree is part of the Python standard library. You are better off using it than rolling your own. (If you were one of the rare people who have some very strange requirements that make you better off writing your own, you wouldn't be asking us. You'd already know.)
https://docs.python.org/2.7/library/xml.etree.elementtree.html#module-xml.etree.ElementTree https://docs.python.org/3.4/library/xml.etree.elementtree.html -- https://mail.python.org/mailman/listinfo/python-list