Get WooCommerce API V1 Response in XML

Not a common request but here a quick snippet that will allow you return the WooCommerce API V1 response in XML instead of JSON. Please note that REST API V2 does NOT allow you to get results in XML.

Simply place that snippet in functions.php in your theme folder:

<?php

add_filter( 'woocommerce_api_default_response_handler' , 'set_woocommerce_api_default_response_handler_to_xml' );

/**
 * set_woocommerce_api_default_response_handler_to_xml
 *
 * @access      public
 * @since       1.0
 * @return      void
*/
function set_woocommerce_api_default_response_handler_to_xml() {

	return 'WC_API_XML_Handler';

}