Code refactor
Code refactor: Move DataValidation related xml code
Prevent while() from causing potential infinite loops

If xml files don't have proper close tags, don't generate an infinite
loop in our library.