public function offsetExists($offset) { if ($this->isNodeOffset($offset)) { return $this->count() > $offset; } else { return $this->hasAttribute($offset); } }