title: Generating xml in python and lxml
body: <p>I have this xml from sql, and I want to do the same by python 2.7 and  lxml </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  &lt;results&gt;
    &lt;Country name="Germany" Code="DE" Storage="Basic" Status="Fresh" Type="Photo" /&gt;
  &lt;/results&gt;
  </code></pre>
  
  <p>Now I have:</p>
  
  <pre><code>from lxml import etree
  
  # create XML 
  results= etree.Element('results')
  
  country= etree.Element('country')
  country.text = 'Germany'
  root.append(country)
  
  
  
  filename = "xmltestthing.xml"
  FILE = open(filename,"w")
  FILE.writelines(etree.tostring(root, pretty_print=True))
  FILE.close()
  </code></pre>
  
  <p>Do you know how to add rest of attributes? </p>