public function getDocument() { if ($this->node->ownerDocument === null) { return null; } return new Document($this->node->ownerDocument); }