Fix for Batch update privileges does not properly index records

https://github.com/geonetwork/core-geonetwork/issues/620
Fix so that correct xml is generated.