add debug function and replace makeArray() with makeNumericArray()
update SelectDataXml to replace empty arrays with nulls, add  flag