function c = getchild(T, indx)
if isempty(indx)
    c = T;
    return;
end
if length(indx)==1
    c = T.children{indx};
    return;
end
if length(T.children)<indx(1)
    c = tree();
    return;
end
c = getchild(T.children{indx(1)}, indx(2:end));
return;