Build resource tree