Hello soyeso,
HauptwerkInternalWorkingFiles contains the cache files, created by Hauptwerk in order to speed up loading of sample sets.
HauptwerkSampleSetsAndComponents contains the Organ Definition Files, Packages and Temperaments.
HauptwerkUserData contains all user data, as the name of the folder suggests. Hauptwerk stores here mainly organ settings, organ combinations, and custom organ definitions (if you create your own organs) for the four different profiles.
I have no idea, what the three XML files in the main folders are good for. On my test system, these files are empty anyhow.
What should you do in order to restore your system?
If you restore HauptwerkSampleSetsAndComponents, you don't have to re-install all sample sets manually.
If you also restore HauptwerkUserData, all of your MIDI programming should work again (as long as your USB ports did not change).
The folder HauptwerkInternalWorkingFiles is the least important folder. If you do not restore this folder, all caches will be rebuild automatically. The first start will take some time, but you do not have any further disadvantages.
You should also check, whether you find the backups, which Hauptwerk automatically creates. If you use the latest backup file, all of the HauptwerkUserData should be restored as well. On a Mac you can find these backup files in ~/Hauptwerk/AutomaticBackups.
Hope this helps!
All the best,
Chris