parse xml errors and return codes and messages