private function convertToCustomField($field)
    {
        if (!empty($field->attributes())) {
            if (isset($field->attributes()->{'field-name'}) && isset($field->attributes()->{'field-value'})) {
                $rawName = (string)$field->attributes()->{'field-name'};
                list($normalizedName, $prefix) = $this->splitFieldNameAndPrefix($rawName);
                $value = (string)$field->attributes()->{'field-value'};
                if (!empty($normalizedName)) {
                    return new CustomField($normalizedName, $value, $prefix);
                }
            }
        }
        return null;
    }