Mashape/mashape-php-library — pull request #2 by richtr (2011-11-25 10:30:08+00:00)
Title: Optional XML API response output support

This patch adds support for XML output to be returned at the discretion of the ComponentAPI.

To set the response type to XML you can simply add the following to any method in a class implementing the MashapeRestAPI (e.g. /api.php):

parent::setOutputToXml();

If you want to change the name of the root XML node (from the default ) then simply pass in the new name for the root node as the only parameter to the function:

parent::setOutputToXml("timezone");

That's it!

***

XML support may also need to be patched to the client libraries.