public static function createFromResponse(\SimpleXMLElement $response) { $shout = new Shout(); $shout->setAuthor((string) $response->author); $shout->setBody((string) $response->body); $shout->setDate((string) $response->date); return $shout; }