I'm building an API for my app and would like to return errors in the XML response that are generated by validation errors.
So say you're registering on the site, right now the validation errors returned might be:
Login has already been taken
Password is too short (minimum is 6 characters)
Email has already been taken
But I'd like to reformat that as:
<errors>
<error>Login has already been taken</error>
<error>Password is too short (minimum is 6 characters)</error>
<error>Email has already been taken</error>
</errors>
So, how would I access the validation error array to do that?