public function attr($name, $value = NULL) {
    if (($el = $this->getElement()) === NULL) return NULL;

    if ($el->hasAttribute($name)) {
      if (func_num_args() == 2) {
        $el->setAttribute($name, $value);
      }

      return $el->getAttribute($name);
    }

    return NULL;
  }