Yes, I have looked at the retail form documentation. I think it's possible to do what I want with it, but it doesn't seem very practical. Writing my own widget might be the the best approach if I understand things correctly.
Just in case, the issue I had with the retail form approach was that I didn't know how to put my html structure complete with the checkboxes contained within, into the form element. Even if I can render the form element by itself, it would just be empty, wouldn't it? How would I put my treeview into it? Does the form render method have some sort of argument, where I could pass my treeview-html to, all from within my template?
Maybe a retail form is ill-suited for my specific application, but I can't help the feeling that I'm missing something obvious.