protected function toXMLInternal(DOMElement $parent, string $namespace, string $name) : DOMElement
    {
        $e = $parent->ownerDocument->createElementNS($namespace, $name);
        $parent->appendChild($e);

        if (empty($this->Name)) {
            throw new \Exception('Cannot convert Attribute to XML with no Name set.');
        }
        $e->setAttribute('Name', $this->Name);

        if ($this->NameFormat !== null) {
            $e->setAttribute('NameFormat', $this->NameFormat);
        }

        if ($this->FriendlyName !== null) {
            $e->setAttribute('FriendlyName', $this->FriendlyName);
        }

        foreach ($this->AttributeValue as $av) {
            $av->toXML($e);
        }

        return $e;
    }
protected function toXMLInternal(DOMElement $parent, string $namespace, string $name) : DOMElement
    {
        $e = $parent->ownerDocument->createElementNS($namespace, $name);
        $parent->appendChild($e);

        if (empty($this->Name)) {
            throw new \Exception('Cannot convert Attribute to XML with no Name set.');
        }
        $e->setAttribute('Name', $this->Name);

        if ($this->NameFormat !== null) {
            $e->setAttribute('NameFormat', $this->NameFormat);
        }

        if ($this->FriendlyName !== null) {
            $e->setAttribute('FriendlyName', $this->FriendlyName);
        }

        foreach ($this->AttributeValue as $av) {
            $av->toXML($e);
        }

        return $e;
    }
protected function toXMLInternal ( DOMElement $ parent , string $ namespace , string $ name ) : DOMElement { $ e = $ parent -> ownerDocument -> createElementNS ( $ namespace , $ name ) ; $ parent -> appendChild ( $ e ) ; if ( empty ( $ this -> Name ) ) { throw new \ Exception ( 'Cannot convert Attribute to XML with no Name set.' ) ; } $ e -> setAttribute ( 'Name' , $ this -> Name ) ; if ( $ this -> NameFormat !== null ) { $ e -> setAttribute ( 'NameFormat' , $ this -> NameFormat ) ; } if ( $ this -> FriendlyName !== null ) { $ e -> setAttribute ( 'FriendlyName' , $ this -> FriendlyName ) ; } foreach ( $ this -> AttributeValue as $ av ) { $ av -> toXML ( $ e ) ; } return $ e ; }
Internal implementation of toXML.
This function allows RequestedAttribute to specify the element name and namespace.

@param \DOMElement $parent The element we should append this Attribute to.
@param string $namespace The namespace the element should be created in.
@param string $name The name of the element.
@return \DOMElement
Internal implementation of toXML . This function allows RequestedAttribute to specify the element name and namespace .