title: Writing ElementTree compressed in gzip format
body: <p>I'm trying to write a spcific subtree of my xml in <code>gzip</code> format. The following <code>Python</code> code writes a regular xml to file and I'm not sure how to add compression to it</p>
  
  <pre><code>import os, time, gzip
  import xml.etree.cElementTree as ET
  from xml.etree.cElementTree import ElementTree
  
  . . . 
  
  ElementTree(child).write('outputFile.xml')      
  </code></pre>
  
  <p>I'd like to write a file <code>outputFile.xml.gz</code> that can be opened with common applications. Keep in mind that I'm new to Python...</p>