I am calling some XMLRPC API and sometimes I am getting some "dirty" response. Dirty response means that along with XML is returned some other content/html like:
<div>Some Html maybe> Or some additional string is here
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodResponse>
<params>
<param>
<value><int>30</int></value>
</param>
</params>
</methodResponse>
I need a way to throw out anything what is not XML and read only XML from string response so from response above I get only:
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodResponse>
<params>
<param>
<value><int>30</int></value>
</param>
</params>
</methodResponse>
If nothing it would be helpful if someone provide code which cleans only HTML and left only XML at least. Prefer code in C#
methodResponse,params, etc.)"dirty" response