private function createXml(SimpleXMLElement $obj, array $array, ?string $prevKey = 'data'): void
    {
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                if (is_numeric($key)) {
                    $node = $obj->addChild($prevKey);
                    $this->createXml($node, $value);
                } elseif ($key == '@attributes') {
                    foreach ($value as $k => $v) {
                        $obj->addAttribute($k, $v);
                    }
                } else {
                    if ($prevKey != '' && !is_numeric($key)) $node = $obj->addChild($prevKey); else $node = $obj;
                    $this->createXml($node, $value, $key);
                }
            } else {
                if (is_numeric($key)) {
                    $obj->addChild($prevKey, $value);
                } else {
                    $obj->addChild($key, $value);
                }
            }
        }
    }