public function toUnsignedXML() : DOMElement
    {
        if ($this->nameId === null) {
            throw new \Exception('Cannot convert SubjectQuery to XML without a NameID set.');
        }
        $root = parent::toUnsignedXML();

        $subject = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:Subject');
        $root->appendChild($subject);

        $this->nameId->toXML($subject);

        return $root;
    }