Made is_valid a property on ValidationResult class. Refactored control xpath validation code to use nested function.