Javascript:Build xml format
<p>I need to build a xml as 
XML: </p>

<pre><code>&lt;Root&gt;
 &lt;Item1 absord="aa"&gt;
     &lt;XItem n="a" v="b"/&gt;
     &lt;XItem n="a" v="b"/&gt;
     &lt;XItem n="a" v="b"/&gt;
 &lt;/Item1&gt;
  &lt;Item1 absord="bb"&gt;
     &lt;XItem n="a" v="b"/&gt;
     &lt;XItem n="a" v="b"/&gt;
     &lt;XItem n="a" v="b"/&gt;
  &lt;/Item1&gt;
&lt;/Root&gt;
</code></pre>

<p>I`ve written a js function as below:   </p>

<pre><code>  function BuildChildXml(s, name,n)
    {
        var xj=OrchGenericObj.GetXMLObj("&lt;R15&gt;&lt;/R15&gt;");
        var INode1 = xj.createElement("Item1");
            INode1.setAttribute("Absord", n)
        var INode = xmlnewObj.createElement("XItem");
        INode.setAttribute("Name", name);
        INode.setAttribute("Urlpath",s);                    
        xj.documentElement.appendChild(INode);
        INode1.appendChild(xj)
    }
</code></pre>

<p>Output:</p>

<pre><code>&lt;Root&gt;
 &lt;Item1 absord="aa"/&gt;
     &lt;XItem n="a" v="b"/&gt; 
  &lt;Item1 absord="bb"/&gt;
     &lt;XItem n="a" v="b"/&gt;
&lt;/Root&gt;
</code></pre>

<p>But i`m not getting the required output.
Please correct the function.</p>
