Align XML() functionality with JSON()

The XML response builder support sending a 404 if the route returns null,
just like the JSON response builder.