const xmlDoc = $.parseXML(` mydrop1`); const $xml = $(xmlDoc).find('body'); $xml.find('span[dd\\:drop_list_uuid]').each(function() { // This is the line that doesn't work console.log($(this).text()) });