public function toNode(DOMDocument $document = null)
    {
        if (null !== $document) {
            $node = $document->createElement('UnitOfMeasure');
            $node->appendChild($document->createElement('UnitCode', $this->getCode()));

            if ($this->getDescription() !== null) {
                $node->appendChild($document->createElement('UnitDescription', $this->getDescription()));
            }

            return $node;
        }

        return new DOMElement('UnitOfMeasure');
    }
public function toNode(DOMDocument $document = null)
    {
        if (null !== $document) {
            $node = $document->createElement('UnitOfMeasure');
            $node->appendChild($document->createElement('UnitCode', $this->getCode()));

            if ($this->getDescription() !== null) {
                $node->appendChild($document->createElement('UnitDescription', $this->getDescription()));
            }

            return $node;
        }

        return new DOMElement('UnitOfMeasure');
    }
@param null|DOMDocument $document

@return DOMElement