Correctly handle XML resource