Data write to an XML file from dhtmlx data view

Hi All,
I’m trying to write the data to the xml file once the changes are made to the data view and not able to figure out how to do it. In the dataview_connector.php i found the following thing

class DataViewDataItem extends DataItem{
/*! return self as XML string
*/
function to_xml(){
if ($this->skip) return “”;

	$str="<item id='".$this->get_id()."' >";
	for ($i=0; $i<sizeof($this->config->text); $i++){
		$extra = $this->config->text[$i]["name"];
		$str.="<".$extra."><![CDATA[".$this->data[$extra]."]]></".$extra.">";
	}
	return $str."</item>";
}

}

But how to use it is what not able to get. I’d attached my code. I want some button on that form that when I’m done with the Answers update the XML should be updated. Use the checklist.html for the testing and please provide me the solution. Thanks in advance.
html.zip (364 KB)