read/write xml header, auto correctness tests