[Slaptool] Add getInstanceTree method.