/** Update the lookup table and the database. */
 public synchronized void update(Document doc) {
   LookupTable lut = LookupTable.getInstance(lutFile);
   Properties props = lut.getProperties();
   Element root = doc.getDocumentElement();
   boolean changed = false;
   Node child = root.getFirstChild();
   while (child != null) {
     if (child instanceof Element) {
       Element term = (Element) child;
       String key = term.getAttribute("key");
       String value = term.getAttribute("value");
       props.setProperty(key, value);
       try {
         index.remove(key);
       } catch (Exception ignore) {
       }
       changed = true;
     }
     child = child.getNextSibling();
   }
   if (changed) {
     try {
       recman.commit();
     } catch (Exception ignore) {
     }
     lut.save();
   }
 }