$PRO_UID = isset($_POST['PRO_UID']) ? $_POST['PRO_UID'] : '746B734DC23311';
$process = new Process($dbc);
$process->Load($PRO_UID);
$dynaform = new dynaform($dbc);
$dynaform->Fields['DYN_UID'] = isset($_POST['DYN_UID']) ? urldecode($_POST['DYN_UID']) : '0';
$dynaform->Load($dynaform->Fields['DYN_UID']);
if (isset($_POST['DYN_UID']) && $_POST['DYN_UID'] !== '') {
    $file = $dynaform->Fields['DYN_FILENAME'];
} else {
    //Hardcode: Sample of xmlform.
    $file = $PRO_UID . '/' . 'myInfo';
}
/* Start Comment: If file doesn't exist, it is created */
if (!file_exists(PATH_DYNAFORM . $file . '.xml')) {
    $newDoc = new Xml_Document();
    $newDoc->addChildNode(new Xml_Node('dynaForm', 'open', '', array('type' => 'xmlform', 'name' => $file)));
    $newDoc->children[0]->addChildNode(new Xml_Node('', 'cdata', "\n"));
    G::verifyPath(dirname(PATH_DYNAFORM . $file . '.xml'), true);
    $newDoc->save(PATH_DYNAFORM . $file . '.xml');
    unset($newDoc);
}
/* End Comment */
/* Start Comment: Create and temporal copy. */
$pathFile = $filter->xssFilterHard(PATH_DYNAFORM . $file . '.xml', 'path');
$copy = implode('', file($pathFile));
$file .= '_tmp0';
$fcopy = fopen($pathFile, "w");
fwrite($fcopy, $copy);
fclose($fcopy);
/* End Comment */
//Removes any other CURRENT_DYNAFORM that could be pending because of a page refresh or a failure