public function parse($xml) { if (!$xml instanceof SimpleXMLElement) { throw new InvalidXMLException(); } if (!isset($xml->channel->item)) { throw new InvalidFeedContentException(); } return Feed::make((array) $xml->channel); }