This code will format the date as YYYYMMDD in each RXA-16 field if the field is not blank.
var values = message.getAllNodes("RXA-16");
for (var i=0 ; i < values.length ; i++) {
var value=values[i]+'';
if (value !== ''){
message.setNode('RXA['+(i+1)+']-16', qie.formatDate("yyyyMMdd", qie.deduceDate(value)));
}
}