Tree Menu expend and Save all To Data to Text

Como indica el nombre del foro en el moveremos todos los temas de dudas que se resuelvan con exito .
Este foro no tendra permisos de escritura.
I want some thing like :
Treemenu expend and all items of data will be save in a textfile.txt

my textMenu is like this :
Pavel
Anik
Akib

etcc.....

And It will be save as txt line by line.

Is it possible with JamTreeList Object Plugin ?

Thanks
usas jamtreelist o el objeto tree de ams?
Yes . or any tree list items expend and save it to a txt file. Is it possible ?
Ese ejemplo es muy mejorable
thanks  Ceone
Esta funcion te crea un string con todos los nodes:
--------------------------- Function TreeToText--------------------------
 -- Args:                                                                   --
-- 	TreeName: The Name of Tree Object.                                       --

   --------------------------------------------------------------------------
function TreeToText(TreeName)

TreeName = TreeName or "Tree1";
local a= 0;
local b;

txt="";

function node(t)
local k;
local c;
local NodeIn;
	if type(t)=='table'then
		for x = 1,#t do
			strNodeIndex=t[x].NodeIndex;
				k = Tree.GetChildren(TreeName,strNodeIndex);
					
				txt = txt..t[x].Text.."\r\n";
				if k then
					txt=node(k);
				end
		end
		return txt;
	end
end

repeat
	b = Tree.GetChildren(TreeName,tostring(a));
	if b then
		txt=node(b);
		break;
	end
	
until b==nil;
	return txt;
end


Debug.ShowWindow(true);
Debug.Print(TreeToText("Tree1"));
Thanks a lot that is this what i am really looking for thanks a lot thanks.
;) para eso estamos...