move XML helpers to separate file