added logging and started xml header