How can I parse the following XML and get values by index? The example below works but it returns all values at once. How do I gain access to each individual node value while inside the Each loop? Is there a way to do it by index?
<?xml version="1.0" encoding="utf-8"?>
<!---->
<GetAccount>
<id>free2rhyme</id>
<password>letmein</password>
<name>jerry mcguire</name>
<age>29</age>
<sex>m</sex>
<location>salt lake city, utah</location>
<language>english</language>
<signup>00/00/0000</signup>
<confirmed>y</confirmed>
<status>a</status>
</GetAccount>
$.get('getAccount.xml', null, function (data) {
var getAccount = $(data).find('GetAccount').each( function(){
var value = $(this).text();
alert(value);
});
}, 'xml');
This will itearte trough all element ‘GetAccount’ subelements and their values: