'Import .nessus file'

def parse(self, xml_file, from_string=False):

    if from_string:
        xml_file = StringIO(xml_file)
    for (event, elem) in ET.iterparse(xml_file):
        if ((event == 'end') and (elem.tag == 'Report')):
            self.name = elem.attrib.get('name')
            continue
        elif ((event == 'end') and (elem.tag != 'ReportHost')):
            continue
        rh_obj = ReportHost(elem)
        if rh_obj:
            self.targets.append(rh_obj)
            if (not self.scan_start):
                self.scan_start = rh_obj.host_start
            if (not self.scan_end):
                self.scan_end = rh_obj.host_end
            if rh_obj.get('host_start'):
                if (rh_obj.host_start < self.scan_start):
                    self.scan_start = rh_obj.host_start
            if (rh_obj.host_end > self.scan_end):
                self.scan_end = rh_obj.host_end
