I have a question about validating XML tags in word documents

How to check if every start tag has it's end tag (<Amend> </Amend> and so on)

for instance:

<Amend>bla bla bla <NumAm>1</NumAM>
bla bla bla </Amend>

<Amend>bla bla bla <NumAm>1</NumAM>
bla bla bla </Amen

There are many tags in document how to check whether some of them are missing or damaged, and to show me where is missing or is damaged