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

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

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

        $shipperNumber = $this->getShipperNumber();
        if (isset($shipperNumber)) {
            $node->appendChild($document->createElement('ShipperNumber', $shipperNumber));
        }

        $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('Shipper');

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

        $shipperNumber = $this->getShipperNumber();
        if (isset($shipperNumber)) {
            $node->appendChild($document->createElement('ShipperNumber', $shipperNumber));
        }

        $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 ( 'Shipper' ) ; $ shipperName = $ this -> getName ( ) ; if ( isset ( $ shipperName ) ) { $ node -> appendChild ( $ document -> createElement ( 'Name' , $ shipperName ) ) ; } $ shipperNumber = $ this -> getShipperNumber ( ) ; if ( isset ( $ shipperNumber ) ) { $ node -> appendChild ( $ document -> createElement ( 'ShipperNumber' , $ shipperNumber ) ) ; } $ address = $ this -> getAddress ( ) ; if ( isset ( $ address ) ) { $ node -> appendChild ( $ address -> toNode ( $ document ) ) ; } return $ node ; }
@param null|DOMDocument $document

@return DOMElement
@param null|DOMDocument $document