[Validator] Minor fix in XmlLoader

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 
| License       | MIT
| Doc PR        | 

An instance of `\SimpleXMLElement` is passed to the `newConstraint` method instead of a string which can lead to weird type juggling issues.