This is quite simple, actually. Check out the table DMX_Entries. It is the heart of the module. It is a self-referencing table. The id field is 'EntryId' and the parent id field is 'CollectionId'.
Peter