$.get(url, function (xml) { var data = $('<div/>'); data.html(xml); data = data.find('localhost'); exc = data.attr('exc'), _name = data.attr('name'); });