I have a JSON file from a web service and want to use this data with a Drupal module. However, this module expects XML data. So I have the idea of overwriting the module. To do this, I need to convert the JSON file in XML, and ensure the file changes from JSON to PHP array.
Does any method or library exist to do this or convert .json file to .xml directly?
Now I have an array that is like the following one:
Array(  => stdClass Object( [sponsor] => stdClass Object( [created_at] => ) ) )
I need to convert this array in:
SimpleXMLElement Object( [@attributes] => Array( [type] => Array( [sponsor] => Array(  => SimpleXMLElement Object( [created-at] => ) ) ) ) )