As a starting point, what about a simple count of tags and their matching end tags (for example, <Amend> occurs 20 times, </Amend> occurs 19 times) and only display a list (or highlight in the document) those tags where the count of start and end values do not match?