system/Format/XMLFormatter.php
public function format($data)
	{
		// SimpleXML is installed but default
		// but best to check, and then provide a fallback.
		if (! extension_loaded('simplexml'))
		{
			// never thrown in travis-ci
			// @codeCoverageIgnoreStart
			throw FormatException::forMissingExtension();
			// @codeCoverageIgnoreEnd
		}

		$output = new \SimpleXMLElement('<?xml version="1.0"?><response></response>');

		$this->arrayToXML((array)$data, $output);

		return $output->asXML();
	}
public function format($data)
	{
		// SimpleXML is installed but default
		// but best to check, and then provide a fallback.
		if (! extension_loaded('simplexml'))
		{
			// never thrown in travis-ci
			// @codeCoverageIgnoreStart
			throw FormatException::forMissingExtension();
			// @codeCoverageIgnoreEnd
		}

		$output = new \SimpleXMLElement('<?xml version="1.0"?><response></response>');

		$this->arrayToXML((array)$data, $output);

		return $output->asXML();
	}
Takes the given data and formats it.

@param $data

@return string|bool (XML string | false)