public function __unset($name)
{
switch ($name) {
case 'contentType':
case 'document':
case 'length':
case 'xpath':
throw new \BadMethodCallException(sprintf('Can not unset property %s::$%s', get_class($this), $name));
}
throw new \BadMethodCallException(sprintf('Can not unset non existing property %s::$%s', get_class($this), $name));
}