output of a python program in an XML file
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3100525/python-and-result-in-xml">python and result in xml</a>  </p>
</blockquote>



<p>My program involves keystroke detection whose code is as follows:</p>

<pre><code>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('&lt;Key&gt;', key)


root.withdraw()

root.mainloop()
</code></pre>

<p>I want the output of this program to be directlu converted in an XML file format.</p>
