public function toXML(DOMElement $parent) : DOMElement
    {
        $e = parent::toXML($parent);

        if (is_bool($this->AuthnRequestsSigned)) {
            $e->setAttribute('AuthnRequestsSigned', $this->AuthnRequestsSigned ? 'true' : 'false');
        }

        if (is_bool($this->WantAssertionsSigned)) {
            $e->setAttribute('WantAssertionsSigned', $this->WantAssertionsSigned ? 'true' : 'false');
        }

        foreach ($this->AssertionConsumerService as $ep) {
            $ep->toXML($e, 'md:AssertionConsumerService');
        }

        foreach ($this->AttributeConsumingService as $acs) {
            $acs->toXML($e);
        }

        return $e;
    }