Exception ORA-31011: XML parsing failed
<p>I am calling a SOAP based webservice using PL/SQL block. The response returned is in the following format:</p>
<pre><code>&lt;env:Envelope xmlns:env=&quot;http://www.w3.org/2003/05/soap-envelope&quot;&gt;
  &lt;env:Header/&gt;
&lt;env:Body&gt;
  &lt;ns0:getDocumentDataResponse xmlns:ns0=&quot;http://xmlns.oracle.com/oxp/service/ScheduleReportService&quot;&gt;
     &lt;ns3:getDocumentData   =&quot;http://xmlns.oracle.com/oxp/service/ScheduleReportService&quot;&gt;JVBERi0xLjYNCjUgMCB       vYmoNCjw8DQovVHlwZSAvWE9iamVjdA0KL1N1YnR5cGUgL0ltYWdlDQov
RmlsdGVyIC9GbGF0ZURlY29kZQ0KL0xlbmd0aCA1MzUNCi9XaWR0aCA5Mg0KL0hlaWdodCAxNQ0K
L0JpdHNQZXJDb21wb25lbnQgOA0KL0NvbG9yU3BhY2UgL0RldmljZVJHQg0KPj4NCnN0cmVhbQ0K
eJztVzuOAjEM5U65yJwip6DgGnOhrai5AhLNLh0SRfZ5nDiexPFktS1PFgqMYz//kiGlD47xeDzS
9WoKPdJ4/4w0s/g40nm9Xo5xeUqLGbhsszWT5LKkU0inky0hpBjrXixGmqI/ivp8yTqmAvivK20f
 WT5fqECOBYXn80nuHGvwxe4aU/hRx2JKE6nkxNfvOetkhkCcFahkVJqxZTx9/9CuiZxQ6jTzXmLM
 ....
 OWExMDllPjxhMWE2NTE2ZDNmYTcwY2Y2NzhkY2EwMWIzZjlhMTA5ZT5dDQo+Pg0Kc3RhcnR4cmVm
 DQoxMDg0MTIwDQolJUVPRg0K&lt;/ns3:getDocumentData&gt;
      &lt;/ns0:getDocumentDataResponse&gt;
      &lt;/env:Body&gt;
&lt;/env:Envelope&gt;
</code></pre>
<p>This response is stored in the variable : l_xml_response_text(varchar2) and when I execute the following code:</p>
<pre><code>l_xml_response_xmltype := xmltype(l_xml_response_text);
</code></pre>
<p>it Is throwing the error:</p>
<blockquote>
<p>Exception ORA-31011: XML parsing failed</p>
<p>ORA-19202: Error occurred in XML processing</p>
<p>LPX-00007: unexpected end-of-file encountered</p>
</blockquote>
<p>Is the issue due to data returned in decoded format? If yes..how can this be handled?</p>