Write Xml Tree To File Python