public function toString() { if ($serializer = $this->serializerFactories()->createSerializer($this->contentType, $this->document)) { return (string) $serializer; } else { throw new Exceptions\NoSerializer($this->contentType); } }