<list parent_id="<?php echo $parentId; ?>" err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>">
  <!-- folders in current folder -->
  <?php foreach ($tblcategories as $tblcategory): ?>
    <folder id="<?php echo $tblcategory->getCatId() ?>" name="<?php echo $tblcategory->getCatName() ?>" filetype="" />
  <?php endforeach; ?>
  <!-- files in current folder -->
  <?php foreach ($tblfiles as $tblfile): ?>
    <file id="<?php echo $tblfile->getFileId() ?>" name="<?php echo $tblfile->getFileName() ?>" filetype="<?php echo $tblfile->getFileType() ?>" />
  <?php endforeach; ?>
</list>