<?
	$xmldoc = new DomDocument('1.0', 'UTF-8');

	// create root node
	$root = $xmldoc->createElement('items');
	$root = $xmldoc->appendChild($root);

	if ($this->dispArr and count($this->dispArr)) {
		foreach ($this->dispArr as $row) {
			$id = $row['id'];
			$name = $row['name'];
			$type = $row['type'];

			$itemNode = $xmldoc->createElement('item');
			$itemNode = $root->appendChild($itemNode);

			$nameNode = $xmldoc->createElement('name', htmlspecialchars($name));
			$nameNode = $itemNode->appendChild($nameNode);

			$typeNode = $xmldoc->createElement('type',$type);
			$typeNode = $itemNode->appendChild($typeNode);

			$idNode = $xmldoc->createElement('id',$id);
			$idNode = $itemNode->appendChild($idNode);

//			$countryNode->setAttribute('code',htmlspecialchars($abbr));
//			$countryNode->setAttribute('continent',htmlspecialchars($continent));
		}
	}

	$data = $xmldoc->saveXML();
	echo $data;
?>