// Creating XML fields.
                $currentTrack[$ii]->appendChild($domtree->createElement($fieldValue, $subStrVal));
            }
            $j++;
        }
        ++$ii;
    }
    // Creating XML files.
    $myfile_terms = fopen("../../public/xml_files/" . $_REQUEST['filename'] . '_batch' . ".xml", "w") or die("Unable to open file !");
    fwrite($myfile_terms, $domtree->saveXML());
    fclose($myfile_terms);
}
// Save configuration
$configName = $_REQUEST['newconfig'];
if (isset($configName) && $_REQUEST['selctconfig'] == '') {
    $saveConfig['location'] = $_REQUEST['location'];
    $saveConfig['field'] = $_REQUEST['field'];
    $saveConfig['confidId'] = $_REQUEST['selctconfig'];
    $saveConfig['newconfig'] = $_REQUEST['newconfig'];
    $saveConfig['filetype'] = $_REQUEST['filetype'];
    if ($_REQUEST['txttoxml']) {
        $saveConfig['txttoxml'] = '1';
    } else {
        $saveConfig['txttoxml'] = '2';
    }
    $saveConfig['tablename'] = $tableName;
    // Save configuration details
    $addConfig = $conversionConfiguration->addConfiguration($saveConfig);
}
echo "XML file Created successfully.";
exit;