code: def xml_records(filename):
      
      with Evtx(filename) as evtx:
          for xml, record in evtx_file_xml_view(evtx.get_file_header()):
              try:
                  yield to_lxml(xml), None
              except etree.XMLSyntaxError as e:
                  yield xml, e
docs: If the second return value is not None, then it is an
        Exception encountered during parsing.  The first return value
        will be the XML string.
  
      @type filename str
      @rtype: generator of (etree.Element or str), (None or Exception)