public function toArray() { $response = $this->simpleXmlObject(); // Converting the SimpleXMLElement Object to array() $response = json_encode($response); return json_decode($response, true); }