Xml.php
protected static function _createChild($data): void
    {
        $dom = $node = $key = $value = $format = null;

        extract($data, EXTR_OVERWRITE);
        $childNS = $childValue = null;
        if (\is_array($value)) {
            if (array_key_exists('@', $value)) {
                $childValue = (string)$value['@'];
                unset($value['@']);
            }
            if (array_key_exists('xmlns:', $value)) {
                $childNS = $value['xmlns:'];
                unset($value['xmlns:']);
            }
        } elseif (!empty($value) || $value === 0) {
            $childValue = (string)$value;
        }

        if ($childValue) {
            $child = $dom->createElement($key, $childValue);
        } else {
            $child = $dom->createElement($key);
        }
        if ($childNS) {
            $child->setAttribute('xmlns', $childNS);
        }

        self::_fromArray($dom, $child, $value, $format);
        $node->appendChild($child);
    }
protected static function _createChild($data): void
    {
        $dom = $node = $key = $value = $format = null;

        extract($data, EXTR_OVERWRITE);
        $childNS = $childValue = null;
        if (\is_array($value)) {
            if (array_key_exists('@', $value)) {
                $childValue = (string)$value['@'];
                unset($value['@']);
            }
            if (array_key_exists('xmlns:', $value)) {
                $childNS = $value['xmlns:'];
                unset($value['xmlns:']);
            }
        } elseif (!empty($value) || $value === 0) {
            $childValue = (string)$value;
        }

        if ($childValue) {
            $child = $dom->createElement($key, $childValue);
        } else {
            $child = $dom->createElement($key);
        }
        if ($childNS) {
            $child->setAttribute('xmlns', $childNS);
        }

        self::_fromArray($dom, $child, $value, $format);
        $node->appendChild($child);
    }
Helper to _fromArray(). It will create childs of arrays

@param array $data Array with informations to create childs
@return void