javascript and xml
I am having a xml file class.xml
<class></class>
as a root tag.I want to insert name tag between it
<class>
<name>test1</name>
<name>test2</name>
</class>
I am using the code in javascript
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.load("class.xml");
var x=xmlDoc.getElementsByTagName("class");
var newel;
for (i=0;i<x.length;i++)
{
newel=xmlDoc.createElement('edition');
x[i].appendChild(newel);
xmlDoc.save();
}
But this code is not inserting the new node
Please let me know where I am wrong

