Update to make XML parsing more flexible