I am not able to select and focus the tree node by default when the tree loads.
it sometimes works and sometimes not

in the xml i am giving selected = 1 attribute

there are 7 to 8 nodes randomly i am changing the selection.

but it always shows me the last selection or the first one.

is there any solution.

a) you can select only one item from XML, there is no way to defined multiple preselected nodes when loading data from XML
b) problem may be caused by caching, please be sure that old XML not cached while reloading tree.