code: public KeePassFile cloneKeePassFile() {
          Iterator<Group> iter = iterator();
  
          while(iter.hasNext()) {
              Group group = iter.next();
  
              Group clonedGroup = cloneGroup(group);
              replace(clonedGroup);
          }
  
          return close();
      }
docs: Creates a cloned {@link KeePassFile} from the current tree structure.
  
  @return a cloned KeePass file