$xml = Xml::fromArray(array('response' => $groups)); echo $xml->asXML();