Using this plugin one can easily collapse/expand pages/custom post types with children and grand children.