public function attr($attr = null, $to_str = false)
    {
        $k = key($this->ids);
        if (null === $k) {
            reset($this->ids);
            $k = key($this->ids);
        }
        return isset($k) ? $this->doc()->get_attr_byId($k, $attr, $to_str) : null;
    }