separate xml parsing  related functions in a separate file
Fix some typos