<?php

	$page_data = $this->info("data");

	/* add the nomalized page info
		*/
	$page_data->editNode("data.page", null, "id=" . $this->info("id") . ";class=" . $this->info("class"));
	$page_data->editNode("data.page.title", $this->info("title"));

	/* add the children
		*/
	$children = Flatfile::getSetTable("child", $this->info("id"));
	$xmlstr = "<data><children>";
	foreach ($children as $key => $obj) {
		$xmlstr .= "<child>";
		$xmlstr .= "<title><![CDATA[" . $obj[1] . "]]></title>";
		$xmlstr .= rawurldecode($obj[2]);
		$xmlstr .= "</child>";
	}
	$xmlstr .= "</child></children></data>";
	$xmlobj = new SimpleXML4($xmlstr);
	$page_data->merge($xmlobj);

	/* manually remove anything that shouldn't be visible
		*/
	$page_data->removeNode("data.child");

	/* do a standard cleanout
		*/
	$this->cleanXmlOutput($page_data->xml_array);

	/* print away
		*/
	//print_r($page_data->toArray());
	print $page_data->toString();

?>