code: public function toNode(DOMDocument $document = null)
      {
          if (null === $document) {
              $document = new DOMDocument();
          }
  
          $node = $document->createElement('Locale');
  
          $node->appendChild($document->createElement('Language', $this->getLanguage()));
          $node->appendChild($document->createElement('Dialect', $this->getDialect()));
  
          return $node;
      }
docs: @param null|DOMDocument $document
  
  @return DOMElement