word searches for first instance of <Amend> tag and before finding the next <Amend> it should find closing tag </Amend> if it finds <Amend> before </Amend> it means that closing tag is missing.
Yes, this is true, but think about it. A search instruction is a search instruction. You search FOR the next <Amend>. You can not search for two things at once. So you say search for <Amend> but before you find <Amend> find </Amend>...it does not work that way. You can look for <Amend> OR you can look for </Amend>. You can not look for both at the same time.

So again, this has to be done - as I posted - by logic. Find the next </Amend>, go back and check if there is an <Amend> between your starting point and end point....yadda yadda yadda.

How do you code this? By coding it using the needed logic, exactly as I posted. This is the problem, it is tedious, fussy and must be completely air tight logic.