how to create category sub-tree with checkboxes for selection

I have categories table and category may have child categories. I want to have categories listing as sub-tree structure. When Page loads, only parent categories will be displayed and that can be expanded to view sub categories. So How can I create checkboxlist like tree structure for this categories.

Please suggest possible solution if any of you have implemented.