src/Entity/AlternateDeliveryAddress.php
public function toNode(DOMDocument $document = null)
    {
        if (null === $document) {
            $document = new DOMDocument();
        }

        $node = $document->createElement('AlternateDeliveryAddress');

        if ($this->getName()) {
            $node->appendChild($document->createElement('Name', $this->getName()));
        }

        if ($this->getUpsAccessPointId()) {
            $node->appendChild($document->createElement('UPSAccessPointID', $this->getUpsAccessPointId()));
        }

        $address = $this->getAddress();
        if (isset($address)) {
            $node->appendChild($address->toNode($document));
        }

        return $node;
    }
public function toNode(DOMDocument $document = null)
    {
        if (null === $document) {
            $document = new DOMDocument();
        }

        $node = $document->createElement('AlternateDeliveryAddress');

        if ($this->getName()) {
            $node->appendChild($document->createElement('Name', $this->getName()));
        }

        if ($this->getUpsAccessPointId()) {
            $node->appendChild($document->createElement('UPSAccessPointID', $this->getUpsAccessPointId()));
        }

        $address = $this->getAddress();
        if (isset($address)) {
            $node->appendChild($address->toNode($document));
        }

        return $node;
    }
@param null|DOMDocument $document

@return \DOMElement