Add some comments describing how the script works
Appliance name has to be specified
Appliance is always required - no pure dom0 option
Explain DOMZERO_USER
Move some items to the first phase
Extract XSINST_DIRECTORY
Move more things to step step 1

This way, these will be logged
move set_xenserver_installer_as_nextboot
rename configure_appliance

Hopefully, I can avoid adding a comment this way
Rename
Rename: set_appliance_network_config
Rename: configure_networking
Create separate scripts
INSTALL_TARGET is a driectory
Fix missing parameter
Inline update_initramfs
More dataflow
Use tail instead of nested cat
Inline update_grub
Change parameters