I am currently working on this code that creates a summary from an XML input file. However, the summary picks up irrelevant information that is towards the end of the file. For instance, I want to read all of the lines of the XML file except when it reaches the following string header, "NOTICE TO APPELLANT". I would like to ignore all the lines that come after that string header.
Also, I am reading the file in binary mode because the XML file is not well formed. So is there a way I can do this while reading the file in binary mode.