load empty XML woudl not fire onXLE event

I have a grid loaded with the xml that comes from database (select *… from myTbl for xml path(‘row’), root(‘rows’)…), in the event that there is no records in the database output xml is this : .

my code:

        var grid = container.attachGrid();
        xml = "xml/statementGrid.xml?rnd=" + new Date();
        grid.attachEvent("onXLS", function (grid_obj) { container.progressOn(); }); 
        grid.attachEvent("onXLE", function (grid_obj, count) {
                if (grid_obj.getRowsNum() > 0) {
                    grid_obj.selectRow(0, true, true, true);

so you see, in the case of data is present in database everything works file, but if there is no data and xml is empty(weel, almost) there is a problem.

I can probably fool it on server side and add dummy row if there is no records in database, but looking for more elegant solution. Any input would be appreciated.
Thanks in advance.

so sorry for being a dumbass, in fact, event onXLE is fired and to display “Record not found”
all you need to do is:

grid.attachEvent("onXLE", function (grid_obj, count) { if (!grid.getRowsNum()){ grid.addRow(grid.uid(), "record not found");} )}; ,
Thank a lot Stanislav (Zenit Champion !!!)