String nipr_url = 'https://pdb-beta.nipr.com/pdb-xml-reports/hitlist_xml.cgi? customer_number=beta83oferta&pin_number=cl053dw0n&report_type=2&license=' + insuranceLicense + '&state=ca';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndPoint(nipr_url);
req.setMethod('GET');
HTTPResponse res = h.send(req);
Dom.document doc = res.getBodyDocument();
//Retrieve the root element for this document.
Dom.XMLNode address = doc.getRootElement();
Dom.XMLNode Transaction_Type = address.getChildElement('TRANSACTION_TYPE', null);
String NIPR_type = Transaction_Type.getChildElement('TYPE', null).getText();
if (NIPR_type == 'ERROR')
return false;
else
return true;