Well, I don't have an example of how to do it, basically because I havn't. My guess, however, would be to use some sort of parent field for each entry.
E.g.:
CREATE TABLE thing (
id int(11) default '0' not null auto_increment,
parent int(11) default '0' not null,
info text,
primary key (id)
);
then, you'd insert some records;
'', '0', 'sometext'
'', '0', 'moretext'
'', '1', 'testtext'
'', '2', 'uglytext'
and so on. Then, use some sort of function to display all entries with parent=0, then display all childrens for those entries, then all children for those children etc etc.
By changing the parent of one entry, it should theoretically move that one with all children to somewhere else. (The 'parent' field would ofcourse contain the 'id' of another entry).