function setDocument(&$document) { if (XMLDocument::validClass($document)) { $this->document =& $document; } }