Fix #309: Added XML support for entities. An XML API will return an error instead of returning a string representation of a response. Failing formatters will get reported with a 500.