Read XML with jQuery

Read XML with jQuery

Hello,

I am trying to get some values from an XML response for a Windows Sidebar Gadget but I failed so far.

This is an example of the XML:

  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <response>
  3. <valid_until>2011-03-07 10:51:06.000997</valid_until>
  4. <data>2146259433</data>
  5. <sms>621</sms>
  6. <credits>14.28</credits>
  7. <sms_super_on_net>990</sms_super_on_net>
  8. <is_expired>False</is_expired>
  9. </response>

And this is how I get it, it is through a common XMLHttpRequest working in every browser.

  1. var response = xmlHttp.responseText;

I have tried doing

  1. var sms = $(response).find('sms').text();

But that didn't work.
What else could I try?

Regards,
Bart