Parsing XML in javascript
<p>I have the following XML</p>

<pre><code>&lt;plist version="1.0"&gt;
    &lt;dict&gt;
        &lt;key&gt;items&lt;/key&gt;
        &lt;array&gt;
            &lt;dict&gt;
                &lt;key&gt;assets&lt;/key&gt;
                &lt;array&gt;
                    &lt;dict&gt;
                        &lt;key&gt;kind&lt;/key&gt;
                        &lt;string&gt;software-package&lt;/string&gt;
                        &lt;key&gt;url&lt;/key&gt;
                        &lt;string&gt;test1&lt;/string&gt;
                    &lt;/dict&gt;
                &lt;/array&gt;
                &lt;key&gt;metadata&lt;/key&gt;
                &lt;dict&gt;
                    &lt;key&gt;bundle-identifier&lt;/key&gt;
                    &lt;string&gt;test&lt;/string&gt;
                    &lt;key&gt;bundle-version&lt;/key&gt;
                    &lt;string&gt;1.0&lt;/string&gt;
                    &lt;key&gt;kind&lt;/key&gt;
                    &lt;string&gt;software&lt;/string&gt;
                    &lt;key&gt;subtitle&lt;/key&gt;
                    &lt;string&gt;pixTraining&lt;/string&gt;
                    &lt;key&gt;title&lt;/key&gt;
                    &lt;string&gt;test&lt;/string&gt;
                &lt;/dict&gt;
            &lt;/dict&gt;
        &lt;/array&gt;
    &lt;/dict&gt;
&lt;/plist&gt;
</code></pre>

<p>if I use this XPath in an xml editor </p>

<pre><code>/plist/dict/array/dict/dict/string[2]
</code></pre>

<p>I get back the version. But when I have the same code in JavaScript, I don't get any thing back. Here is my JavaScript code</p>

<pre><code>var elements = doc.evaluate('//plist/dict/array/dict/dict/string[2]');
</code></pre>

<p>I don't get anything back. <code>elements</code> is coming as <code>undefined</code>. Any clues why?</p>
