Possible Duplicate:
python and result in xml
My program involves keystroke detection whose code is as follows:
import Tkinter as tk
def key(event):
if event.keysym == 'Escape':
root.destroy()
print event.char
root = tk.Tk()
print "Press a key (Escape key to exit):"
root.bind_all('<Key>', key)
root.withdraw()
root.mainloop()
I want the output of this program to be directlu converted in an XML file format.