title: Parsing XML that was received as an response in javascript,
body: <pre><code>function parsingXML(APIResponse){ 
      var txt  = APIResponse.responseXML;
          if (window.DOMParser)
          {
          parser=new DOMParser();
          xmlDoc=parser.parseFromString(txt,&quot;text/xml&quot;);
          }
          else // Internet Explorer
          {
          xmlDoc=new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);
          xmlDoc.async=false;
          xmlDoc.loadXML(txt);
          }
          console.log(APIResponse)
           console.log(xmlDoc.getElementsByTagName(&quot;SCID_WEB_REF_NUMBER&quot;)[0].childNodes[0].nodeValue);
  }
  </code></pre>
  <p>this is the error which was shown in the console</p>
  <pre><code>error TypeError: Cannot read property 'childNodes' of undefined
  </code></pre>
  <p>and the responseXML is :</p>
  <pre><code>&quot;&lt;NewDataSet&gt;\r\n  &lt;Table&gt;\r\n    &lt;SCID_WEB_REF_NUMBER&gt;PIVP1005202112332381&lt;/SCID_WEB_REF_NUMBER&gt;\r\n    &lt;SCID_SBIL_SUPERVISOR_ID&gt;O2026&lt;/SCID_SBIL_SUPERVISOR_ID&gt;\r\n    &lt;SCID_TYPE_OF_CLAIM&gt;Sampoorna Suraksha&lt;/SCID_TYPE_OF_CLAIM&gt;\r\n    &lt;SCID_INVESTIGATION_TYPE&gt;Document Procurement&lt;/SCID_INVESTIGATION_TYPE&gt;\r\n    &lt;SCID_POLICY_NUMBER&gt;72112051821&lt;/SCID_POLICY_NUMBER&gt;\r\n    &lt;SCID_CUSTOMERID_EMPLOYEEID&gt;50846&lt;/SCID_CUSTOMERID_EMPLOYEEID&gt;\r\n    &lt;SCID_CLAIMID&gt;5082036&lt;/SCID_CLAIMID&gt;\r\n    &lt;SCID_UNIQUE_ID&gt;72112051821|50846|5082036|&lt;/SCID_UNIQUE_ID&gt;\r\n    &lt;SCID_NAME_OF_LA&gt;samay&lt;/SCID_NAME_OF_LA&gt;\r\n    &lt;SCID_DOB_OF_LA&gt;1985-07-05T00:00:00+05:30&lt;/SCID_DOB_OF_LA&gt;\r\n    &lt;SCID_STATE_OF_LA&gt;Delhi&lt;/SCID_STATE_OF_LA&gt;\r\n    &lt;SCID_INCOME_OF_LA&gt;0&lt;/SCID_INCOME_OF_LA&gt;\r\n    &lt;SCID_PINCODE&gt;0&lt;/SCID_PINCODE&gt;\r\n    &lt;SCID_DATE_OF_COMMENCEMENT&gt;2019-12-08T00:00:00+05:30&lt;/SCID_DATE_OF_COMMENCEMENT&gt;\r\n    &lt;SCID_SUM_ASSURED&gt;500000&lt;/SCID_SUM_ASSURED&gt;\r\n    &lt;DATE_OF_REVIVAL&gt;0001-01-01T00:00:00+05:30&lt;/DATE_OF_REVIVAL&gt;\r\n    &lt;SCID_DATE_OF_DEATH&gt;0001-01-01T00:00:00+05:30&lt;/SCID_DATE_OF_DEATH&gt;\r\n    &lt;SCID_NAME_OF_CLAIMANT&gt;rahul&lt;/SCID_NAME_OF_CLAIMANT&gt;\r\n    &lt;SCID_CONTACT_NO_OF_CLAIMANT&gt;9895123482&lt;/SCID_CONTACT_NO_OF_CLAIMANT&gt;\r\n    &lt;SCID_CONTACT_NUMBER_OF_LA&gt;8975412327&lt;/SCID_CONTACT_NUMBER_OF_LA&gt;\r\n    &lt;SCID_STATUS&gt;Inprogress&lt;/SCID_STATUS&gt;\r\n    &lt;SCID_CREATEDATE&gt;2021-05-10T12:33:23+05:30&lt;/SCID_CREATEDATE&gt;\r\n    &lt;SCVID_VENDOR_SUPERVISOR_ID&gt;VS4&lt;/SCVID_VENDOR_SUPERVISOR_ID&gt;\r\n    &lt;SCVID_VENDOR_INV_ID&gt;VI1&lt;/SCVID_VENDOR_INV_ID&gt;\r\n    &lt;SCVID_EXPIRES_ON&gt;2023-06-06T00:00:00+05:30&lt;/SCVID_EXPIRES_ON&gt;\r\n    &lt;SCVID_ASSIGNED_BY&gt;VS4&lt;/SCVID_ASSIGNED_BY&gt;\r\n    &lt;SCVID_STATUS&gt;AllocatedToInvestigator&lt;/SCVID_STATUS&gt;\r\n    &lt;ALLOCATION_DATE&gt;2021-06-19T16:25:11+05:30&lt;/ALLOCATION_DATE&gt;\r\n    &lt;AGE&gt;36&lt;/AGE&gt;\r\n    &lt;POLICYDURATION&gt;-15&lt;/POLICYDURATION&gt;\r\n  &lt;/Table&gt;\r\n&lt;/NewDataSet&gt;&quot;
  </code></pre>
  <p>This is what is store in the APIResponse variable and passed into the parsingXML function</p>
  <p>how do I parse this xml and get the data out of these xml tags, no matter what i tried, i was unable to figure it out.</p>
  <p>the goal is to extract all the data from the xml response and store it in variables for futher processing.</p>