title: xml.etree.ElementTree - Trouble setting xmlns = '...'
body: <p>I must be missing something. I'm attempting to set up a google product feed, but am having a hard time registering the namespace. </p>
  
  <p>Example: </p>
  
  <p>Directions here: <a href="https://support.google.com/merchants/answer/160589" rel="nofollow">https://support.google.com/merchants/answer/160589</a></p>
  
  <p>Trying to insert: </p>
  
  <pre><code>&lt;rss version="2.0" 
  xmlns:g="http://base.google.com/ns/1.0"&gt;
  </code></pre>
  
  <p>This is the code:</p>
  
  <pre><code>from xml.etree import ElementTree
  from xml.etree.ElementTree import Element, SubElement, Comment, tostring
  
  tree = ElementTree
  tree.register_namespace('xmlns:g', 'http://base.google.com/ns/1.0')
  top = tree.Element('top')
  #... more code and stuff
  </code></pre>
  
  <p>After code is run, everything turns out fine, but we're missing the <code>xmlns=</code></p>
  
  <p>I find it easier to create XML docs in php, but I figured I'd give this a try. Where am I going wrong? </p>
  
  <p>On that note, perhaps there is a more appropriate way to do this in python, not using etree?</p>