Added Validation

Include XSD file to validate against and refactored code for improved
clarity