code: function toXML($addXMLDeclaration = true)
      {
          $xmlString = $addXMLDeclaration ? "<?xml version=\"1.0\"?><mailing></mailing>" : "<mailing></mailing>";
          $xml = new SimpleXMLElement($xmlString);
  
          if (isset($this->id)) $xml->addChild("id", $this->id);
  
          if (isset($this->fields)) {
              $standard_fields = $xml->addChild("fields");
              foreach ($this->fields as $index => $value) {
                  $field = $standard_fields->addChild("field");
                  $field->addChild("name", $index);
  
                  XMLUtils::addChildAsCDATA($field, "value", $value);
              }
          }
  
          return $xml;
      }
docs: Serialization to a simple XML element.
  
  @param bool $addXMLDeclaration
  
  @return \em SimpleXMLElement
  Generate a XML element from the contact object.