public function __get($name) { switch ($name) { case 'tag': return $this->node->tagName; break; default: return $this->getAttribute($name); } }