add xml read/write and other tool improvements