I need a script that will parse an xml file and clean up misplaced tags. I'm running into a problem where I get xml files that have a badly placed tags. I need to move these files to a specified directory so, I can review them.
I.e. The Open and close <One> tags are okay, but the <Two> is badly placed in between those tags. The same goes for the <Four> tag
<status> <One> Some text in here <Two> more text </One> <Three> Some more text here <Four> which I would like to keep. </Three> </status>