Python script to extract nested folders from a kml file