how to handle grid with subgrid if no record found


I am using grid with subgrid with pagination to display records from database. Fetching records from database and generating XML files for the grid. Now if the record count is 0 then, the paging message is dispalying "No record found ".It is fine. But it alert the javascript alert with error message that says “Error type: LoadXML

Description: Incorrect XML”. how to handle this situation? i am not creating the XML file at all if the record count is 0. Please help to handle this situation.



Reasons of incorrect xml could be:XML data is invalid ( invalid structure of XML );
- if some kind of server side error occurs, error or debug output may break valid xml data;
- invalid content type ( must be a text/xml for XML data );
- whitespaces before <?xml output;
- not escaped special characters, such as &, <, >;
- incorrect encoding of data.

- use debug version of dhtmlxcommon.js , which will show extended error info;
- load the same URL in separate browser window - it will show reason and location of error;
- correctly escape special characters in XML data.