src/XQueue/Maileon/API/Contacts/CustomFields.php
function toXML()
    {
        $xml = new SimpleXMLElement("<?xml version=\"1.0\"?><custom_fields></custom_fields>");
        if (isset($this->custom_fields)) {
            foreach ($this->custom_fields as $index => $type) {
                $field = $xml->addChild("field");
                $field->addChild("name", $index);
                $field->addChild("type", $type);
            }
        }

        return $xml;
    }
function toXML()
    {
        $xml = new SimpleXMLElement("<?xml version=\"1.0\"?><custom_fields></custom_fields>");
        if (isset($this->custom_fields)) {
            foreach ($this->custom_fields as $index => $type) {
                $field = $xml->addChild("field");
                $field->addChild("name", $index);
                $field->addChild("type", $type);
            }
        }

        return $xml;
    }
Serialization to a simple XML element.

@return \em SimpleXMLElement
Generate a XML element from the custom fields list.