Sync from xmltools
Make the tree works on ajax request