private static void deleteZnodeRecursively(ZooKeeper zkClient, String baseNode) throws KeeperException, InterruptedException {
    for (String child : zkClient.getChildren(baseNode, null)) {
      deleteZnodeRecursively(zkClient, append(baseNode, child));
    }
    System.out.println("Deleting znode " + baseNode);
    zkClient.delete(baseNode, -1);
  }
I'm a command line utility that provides functionality that the official zookeeper-client does not support.
E.g. I can set ACLs recursively on a znode.
Also I can remove znode recursively.
ambari-agent/src/main/java/org/apache/ambari/tools/zk/ZkMigrator.java