Adding an attibute and value to an xml using xml.dom.minidom python
<p>How can i add an attribut and value to an xml using xml.dom.minidom python.</p>

<p>My xml is as follows </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;PackageInfo xmlns="http://someurlpackage"&gt;


&lt;data ID="http://someurldata1"&gt;data1&lt;/data &gt;
&lt;data ID="http://someurldata2"&gt;data2&lt;/data &gt;
&lt;data ID="http://someurldata3"&gt;data3&lt;/data &gt;
&lt;/PackageInfo&gt;
</code></pre>

<p>I want to add a new 'data' tag and it's id as 'http://someurldata4' and value as data4.So that the resulting xml will be as below.Sorry I don't want to use xml.etree.ElementTree</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;PackageInfo xmlns="http://someurlpackage"&gt;
&lt;data ID="http://someurldata1"&gt;data1&lt;/data &gt;
&lt;data ID="http://someurldata2"&gt;data2&lt;/data &gt;
&lt;data ID="http://someurldata3"&gt;data3&lt;/data &gt;
&lt;data ID="http://someurldata4"&gt;data4&lt;/data &gt;
&lt;/PackageInfo&gt;
</code></pre>

<p>Thanks</p>
