code: public function toNode(DOMDocument $document = null)
      {
          if (null === $document) {
              $document = new DOMDocument();
          }
  
          $node = $document->createElement('ReferenceNumber');
  
          if ($this->getBarCodeIndicator()) {
              $node->appendChild($document->createElement('BarCodeIndicator'));
          }
          $node->appendChild($document->createElement('Code', $this->getCode()));
          $node->appendChild($document->createElement('Value', $this->getValue()));
  
          return $node;
      }
docs: @param null|DOMDocument $document
  
  @return DOMElement