Fixed undefined esc_atr function error
API: Add XML generation

This commit completes the XML response handler and adjusts the output
format for all resources to include a top-level property that encloses
the response. This is more consistent with the multi-resource (e.g. GET
/orders) response.

Part of #4165
Merge pull request #4177 from maxrice/rest-api-xml-issue-4165

API: Add XML generation
order totals #4042
order notes #4042
order totals #4042
order items #4042
reports #4042
chosen #4042
tax rates table #4042
debug report #4042
status_table #4042