protected function setDocument(dom\document $doc) { $doc->setHandler($this); $this->document = $doc; }