How to extract part of the resultXML of $.ajax() call?

How to extract part of the resultXML of $.ajax() call?


  1. $.ajax({
  2.         type: "POST", 
  3.         url: "some_url",
  4.         dataType: "xml",
  5.         success: function(result){
  6.                 // code...
  7.         }       
  8. });

The code above returns me the following XML:

  1. <ALL>
  2.   <FIRST>
  3.     <content>of the first xml...</content>
  4.   </FIRST>
  5.   <SECOND>
  6.     <some>other xml...</some>
  7.   </SECOND>
  8.   <THIRD>
  9.     <content>of a DHTMLX grid</content>
  10.   </THIRD>
  11. </ALL>

I would like to assign the third XML to a DHTMLX grid but I'm not able to extract it from the output of the ajax call. The following command

  1. console.log($(result).find("THIRD").text());

only outputs the THIRD XML without tags. It has output only the content of tags but the tags are missing, so I cannot assign this content to a grid.

How to extract the THIRD xml from the result of $.ajax() call?