If we want to actually build a treeview i.e. a nested structure, how do we guarantee that we have it? And I will elaborate.
What if I select the inner most node (say item with index 220.127.116.11). What should be copied over? Just the node?
Then I select it's parent (1.5.6). When the treeview is updated do we show the parent / child relation?
Then I select a new end node (18.104.22.168). How do we show that? do we show it at the same level as 1.5.6? Because if we do, it will not be an accurate representation.
If we are to complicate the "show checkbox" logic, say dont show it on the top level and on the 3 and then 5th and so on and so forth, how do we construct the tree then?
To sum up, showing the checked items is quite easy -- just iterate over the datasource, as shown in the article I've sent you. Displaying them in a nested fashion is hard or next to impossible due to various customization options.