How to call set_response_xml correctly in php connector

Hi, I am a littlebit irritated about documentation of set_response_xml.
What I want/need to do is write custom labels in a tree which is managed by a treeconnector.

If not working with treeconnector, it works well.
For example loading this xml file makes no problems:

<?xml version="1.0" encoding="iso-8859-1"?> <![CDATA[]]> <![CDATA[deeper Demo Text]]>

The corresponding js code:
function init()
{
var main_layout = new dhtmlXLayoutObject(document.body, ‘1C’);

var a = main_layout.cells('a');
a.hideHeader();
var tree = a.attachTree();
tree.loadXML("test.xml");

}

But there is no complete description out there, how to work together with a treeconnector.
So I am lost with the following none-working version!

I know, that afterProcessing is only called after insert, update, delete but I tried also other events and no one worked!

<?php require_once("config.php"); $database=mysql_connect($srv,$usr,$pwd); mysql_select_db($mysql_db); require("tree_connector.php"); $treeConnector = new TreeConnector($database); function custom_text($action) { $action->set_response_xml("It works"); } $treeConnector->event->attach( "afterProcessing", custom_text ); $treeConnector->render_table("xref_object_subject","id","title,element_type","","pid" ); ?>

Does anybody know, how to use set_response_text() ?

Thanks in advance!

As result of the above code after data saving you will have xml response like

It works

on client side you can use onAfterUpdate handler of dataprocessor to access the custom data, sent from server side. This can be used if you need to transfer some data back to client side after saving operation.

If you want to customize the content of tree - you need to use beforeRender event

function custom_format($item){ if ($item->get_value("duration")>10) $item->set_image("lock.gif"); if ($item->get_value("complete")>75) $item->set_check_state(1); } $tree->event->attach("beforeRender",custom_format);