public function getAttributeLegacy($name, $default = null) { if (method_exists($this, 'getAttribute')) { return parent::getAttribute($name); } if ($this->element instanceof SimpleXMLElement) { $attributes = $this->element->attributes(); if (property_exists($attributes, $name)) { $value = $attributes->{$name}; if ($value !== null) { return (string) $value; } } } return $default; }