Before any package goes in:
bashL xmllint --noout package-info.xml
Silence means the XML is well-formed. A bad file gets the line number and the fault, e.g. line 4: Opening and ending tag mismatch: install line 3. From now on I run that on every XML I hand you, before you ever see it.