public function fromHash($hash) { if (!isset($hash['xml'])) { throw new RuntimeException("'xml' index is missing in hash."); } return $this->acceptValue($hash['xml']); }