Expand selected branches with multiple loadXML

Hello,
I have a tree with dynamicLoading enabled.
I hava list of nodes to expand and need to expand them one after another, because they are on level0,level1,…,levelN.
I hava a loop

for (j=0;j<pathArr.length;j++)
{
 myTree.loadXML(pathArr[j]);
}

array content is:
lev1ValX,lev1ValX_lev2ValY,lev1ValX_lev2ValY_lev3_ValZ
Sometimes it works fine, but other times the requests (at least in access.log) are NOT in the order the array is.

My question is:
How to load tree with many calls of loadXML() and force each call to wait for the previous one to complete. Or is thera another way to expand a few branches with dynamicLoading?

Regards,
Ludwik

This feature is available for ‘pro’ version users only I think.
First option is loop that checks getXMLState():

function wait() { document.getElementById("progress").innerHTML+=number; number++; if(tree.getXMLState() == true) { timer = setTimeout('wait()',1000); } }
before loading next branch of tree.
But it did not work as I expected.
Happily I found openItemsDynamic() function, which solves the problem and loads many branches one after another.