function __construct($doc = '', $pos = 0, $root = null) { if ($root === null) { $root = new $this->root('~root~', null); } $this->root =& $root; parent::__construct($doc, $pos); }