jQuery 1.6.1 add a new node in XML
<p>jsFiddle URL : <a href="http://jsfiddle.net/rcrathore/Y8DpM/" rel="nofollow">http://jsfiddle.net/rcrathore/Y8DpM/</a></p>

<p>I am trying to add a new node in XML using jQuery. Following code works fine in Firefox, Safari and Chrome but giving error in IE8:</p>

<pre><code>    &lt;div id="result"&gt; &lt;/div&gt;
&lt;div id="result2"&gt; &lt;/div&gt;

&lt;script type="text/javascript"&gt;
&lt;!--
    var xml = "&lt;root&gt;&lt;node1&gt;&lt;node2&gt;TEXT1&lt;/node2&gt;&lt;/node1&gt;&lt;/root&gt;" ;
    var $xml = $($.parseXML(xml)) ;

    var newData = "&lt;node3&gt;234&lt;/node3&gt;" ;
    var $newData = $($.parseXML(newData));
    var newNode = null;

    if (typeof document.importNode == 'function') {
         newNode = document.importNode($newData.find('node3').get(0),true);
    } else {
         newNode = $newData.find('node3').get(0)
    }


    try {


        $(newNode).appendTo($xml.find("node2"));
        /* expected TEXT1234*/
        $("div#result").html($xml.text()); 

        /* expected 234*/
        $("div#result2").html($xml.find("root &gt; node1 &gt; node2 &gt; node3").text());

    } catch (e) {
        alert(e) ;
        $("div#result").html("Error: " + e.description);
    }
//--&gt;
&lt;/script&gt;
</code></pre>

<p>The error description on IE8 is "Wrong number of arguments or invalid property assignment". </p>

<p>Is there a way to fix this on IE8?</p>
