jQuery parseXML

by Alvin Olavarrieta

JavaScript

var data = '<response xmlns=""><rates>						<response_code>0</response_code>												<countryID>14</countryID>												<country_name>Argentina</country_name>												<destination_area_code>54</destination_area_code>												<destination_description>Landline</destination_description>												<destination_currency>USD</destination_currency>												<global_destination>1</global_destination>												<currency_symbol>$</currency_symbol>												<product columns="4">														<destination_rate_1>0.00000</destination_rate_1>														<product_name_1>Global Voip</product_name_1>														<destination_rate_2>0.01900</destination_rate_2>														<product_name_2>National Voip</product_name_2>														<destination_rate_3>0.00000</destination_rate_3>														<product_name_3>Global+ VOIP</product_name_3></product>							</rates>						<rates>											<response_code>0</response_code>												<countryID>14</countryID>												<country_name>Argentina</country_name>												<destination_area_code>549</destination_area_code>												<destination_description>Mobile</destination_description>												<destination_currency>USD</destination_currency>												<global_destination>1</global_destination>												<currency_symbol>$</currency_symbol>												<product columns="4">														<destination_rate_1>0.14900</destination_rate_1>														<product_name_1>Global Voip</product_name_1>														<destination_rate_2>0.14900</destination_rate_2>														<product_name_2>National Voip</product_name_2>														<destination_rate_3>0.11900</destination_rate_3>														<product_name_3>Global+ VOIP</product_name_3>												</product>										</rates></response>';

xmlDoc = $.parseXML(data),
$xml = $(xmlDoc);

console.log($xml.find('rates:eq(0)').find('product').children(':odd'));

$(xml).find('rates:eq(0)').find('product').children(':odd').each(function(index, element) {
    $this =...