code cleanup
added xml prolog
logging improvments
bug fix for missing headers