xml_str2json method returns Null :: Xml to Json Conversion in AngularJs
<p><strong>XML to be converted to json</strong></p>

<pre><code>ns1:UnderwritingRequest xmlns:xsd="" xmlns:xsi="" xmlns:ns1="ABCD" ResponseQueueName=""&gt;
  &lt;ns1:Header&gt;
    &lt;ns1:TrackingId&gt;ABCDEF&lt;/ns1:TrackingId&gt;
    &lt;ns1:PartnerId&gt;Myhome&lt;/ns1:PartnerId&gt;
    &lt;ns1:ProductIdentifier&gt;33&lt;/ns1:ProductIdentifier&gt;
    &lt;ns1:ProductRollupId&gt;22&lt;/ns1:ProductRollupId&gt;
    &lt;ns1:ProductLoanClass&gt;KYC&lt;/ns1:ProductLoanClass&gt;
    &lt;ns1:CustomerId&gt;123&lt;/ns1:CustomerId&gt;
  &lt;/ns1:Header&gt;
  &lt;ns0:Application xmlns:ns0="ABCDE"&gt;
    &lt;ns0:SourceId&gt;Web&lt;/ns0:SourceId&gt;
    &lt;ns0:ApplicationNumber&gt;3AAA&lt;/ns0:ApplicationNumber&gt;
    &lt;ns0:ApplicationUniqueId&gt;3AAA&lt;/ns0:ApplicationUniqueId&gt;
    &lt;ns0:SubmitDate&gt;2015-07-15&lt;/ns0:SubmitDate&gt;
    &lt;ns0:OriginalDate&gt;2015-07-15&lt;/ns0:OriginalDate&gt;
    &lt;ns0:ExpirationDate&gt;2015-07-25&lt;/ns0:ExpirationDate&gt;
    &lt;ns0:InitialSubmitDate&gt;2015-07-15&lt;/ns0:InitialSubmitDate&gt;
    &lt;ns0:IsApplicationSigned&gt;true&lt;/ns0:IsApplicationSigned&gt;
    &lt;ns0:SignedDate&gt;2015-07-15&lt;/ns0:SignedDate&gt;
    &lt;ns0:IsApplicationAccepted&gt;true&lt;/ns0:IsApplicationAccepted&gt;
    &lt;ns0:AcceptedAmount&gt;0&lt;/ns0:AcceptedAmount&gt;
    &lt;ns0:DecisionType&gt;NO&lt;/ns0:DecisionType&gt;
    &lt;ns0:IPAddress&gt;1.1.1.1&lt;/ns0:IPAddress&gt;
    &lt;ns0:IsAllFaxesReceived&gt;false&lt;/ns0:IsAllFaxesReceived&gt;
    &lt;ns0:Contact&gt;
      &lt;ns0:FirstName&gt;Testzqdp&lt;/ns0:FirstName&gt;
      &lt;ns0:LastName&gt;Autozqdp&lt;/ns0:LastName&gt;
      &lt;ns0:DateOfBirth&gt;1964-02-25&lt;/ns0:DateOfBirth&gt;
      &lt;ns0:SSN&gt;15951&lt;/ns0:SSN&gt;
      &lt;ns0:DriversLicenseNumber&gt;HASDFASDF&lt;/ns0:DriversLicenseNumber&gt;
      &lt;ns0:DriversLicenseState&gt;TX&lt;/ns0:DriversLicenseState&gt;
      &lt;ns0:IsActiveMilitary&gt;false&lt;/ns0:IsActiveMilitary&gt;
      &lt;ns0:EMailAddress&gt;test449794@email.com&lt;/ns0:EMailAddress&gt;
      &lt;ns0:EMailYears&gt;0&lt;/ns0:EMailYears&gt;
      &lt;ns0:EMailMonths&gt;0&lt;/ns0:EMailMonths&gt;
      &lt;ns0:HomePhone&gt;9727253097&lt;/ns0:HomePhone&gt;
      &lt;ns0:CellPho`enter code here`ne&gt;973097&lt;/ns0:CellPhone&gt;
    &lt;/ns0:Contact&gt;
</code></pre>

<p>Fetch Operation in AngularJS</p>

<pre><code>var json = x2js.xml_str2json(data.XDocResponse[0]);
</code></pre>

<p>The i/p parameter contains the xml, but json object comes null, i have iterated through index, other  nodes of xml as well, but no luck.
is there any problem with xml structure?</p>

<p>Please help me as i am stuck from 2 days, any help is greatly appreciated</p>