public function attr(string $name, string $value = null)
    {
        if ($value === null) {
            if (isset($this->customAttributes[$name])) {
                return $this->customAttributes[$name];
            }

            throw new SsmlException('Unknown attribute ' . $name . ' in class ' . get_class($this));
        }

        $this->customAttributes[$name] = $value;
        return $this;
    }