title: how to set value using xml.dom.minidom python
body: <p>I having a variable <code>c</code> that has value <code>"test"</code> I tried to assign that value to the <code>Cookie</code> attribute by using <code>xml.dom.minidom</code> in python. I tried following code:</p>
  
  <pre><code>l='&lt;Lg Cookie=""/&gt;'
  dom = parseString(l)
  
  L=dom.getElementsByTagName('Lg')[0]
  lgs = L.setAttribute("Cookie",c)
  
  print lgs
  </code></pre>
  
  <p>Not giving anything; expected output:</p>
  
  <pre><code>l='&lt;Lg Cookie="test"/&gt;' 
  </code></pre>