public function offsetGet($offset) { if ($this->isNodeOffset($offset)) { return $this->childNodes->item((int) $offset); } else { return $this->getAttribute($offset); } }