static void exportPage(StorageImpl db, XMLExporter exporter, int pageId, int type, int height)
      throws java.io.IOException
    {
        Page pg = db.getPage(pageId);
        try { 
            int i, n = getnItems(pg);
            if (--height != 0) {
                if (type == ClassDescriptor.tpString || type == ClassDescriptor.tpArrayOfByte) { // page of strings
                    for (i = 0; i <= n; i++) { 
                        exportPage(db, exporter, getKeyStrOid(pg, i), type, height);
                    }
                } else { 
                    for (i = 0; i <= n; i++) { 
                        exportPage(db, exporter, getReference(pg, maxItems-i-1), type, height);
                    }
                }
            } else { 
                if (type == ClassDescriptor.tpString || type == ClassDescriptor.tpArrayOfByte) { // page of strings
                    for (i = 0; i < n; i++) {
                        exporter.exportAssoc(getKeyStrOid(pg, i), 
                                             pg.data, 
                                             BtreePage.firstKeyOffs + BtreePage.getKeyStrOffs(pg, i),
                                             BtreePage.getKeyStrSize(pg, i),
                                             type);
                    }
                } else { 
                    for (i = 0; i < n; i++) { 
                        exporter.exportAssoc(getReference(pg, maxItems-1-i), 
                                             pg.data, 
                                             BtreePage.firstKeyOffs + i*ClassDescriptor.sizeof[type], 
                                             ClassDescriptor.sizeof[type],
                                             type);
                                             
                    }
                }
            }
        } finally { 
            db.pool.unfix(pg);
        }
    }