protected function putChildsAsCDATAFromList(
        SimpleXMLElement $element,
        array $childs,
        bool $ignore_empty = false
    ) : int {
        $count = 0;

        if (count($childs) > 0) {
            foreach ($childs as $field => $child) {
                if ($this->nb_data_object->contains($field) &&
                    (!$ignore_empty ||
                     !$this->nb_data_object->isValueNull($field) ||
                     !$this->nb_data_object->isValueEmptyString($field)
                    )
                ) {
                    $element->addChild($child, $this->packCDATA($this->nb_data_object->getValue($field)));
                    $count++;
                }
            }
        }

        return $count;
    }