Any ideas how to query for all the children and the children of the children in a single query?
Update
It seems like a simple question. I doubt if there is a simple solution?
Quering the tree of folders and files can cost a lot of API calls. So, to solve my problem, I use a single query to list all the files and folders of an owner. This query also returns subfiles and subfolders. To find the folder and all of its children (folder, files, subfolders and subfiles) in the list, I had to create a tree like index.
Conclusion
A single query is not enough. You have to list all or narrow the query with an owner. Next You have to index the results to (recursive) find the tree for the folder.
A query option like (ls -R in Unix) would be nice.