how to clone nested lists

how to clone nested lists

Hello

i wish to develop a simple tool to clone nested elements.
Say I have something like the following, where the B's are buttons:
-- list B1
---- sublist B2
------ subsublist B3
(call it the template)

By clicking a button, the corresponding (sub)list, with its sublist(s), should be appended below itself, and it should be possible to redo that more times. However, I want to clone just elements/lists from the original template.

If you know of a piece of code that does something close, I appreciate if you let me see it.
Your advise is wecome.
Thanks
Cheers
mario