private static Element getElementByIdType(Document doc, String id) {
      if (true)
        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "getElementByIdType() Search for ID " + id);
       WeakHashMap elementMap;
       synchronized (docMap) {
           elementMap = (WeakHashMap) docMap.get(doc);
       }
       if (elementMap != null) {
           WeakReference weakReference = (WeakReference) elementMap.get(id);
           if (weakReference != null)
           {
                return (Element) weakReference.get();   
           }
       }
       return null;
   }