When querying on All Packages, results will include all matching entities (requirements, scripts, script assignments or incidents) directly in the package/folder and in any of its sub packages/folders.
Return all entities within any package named requirements, or any of its children:
Return all entities with the package 'Script Library|Cycle 1|Reporting' (this shows passing the package with its full path) or any of its child packages:
Return all entities within either of the two packages (or their children), but only in the project 'Project X':
Return all entities within the package with Unique ID "cf1264f7-4e53-4e6d-b0a2-9f6c00a3a244", or any of its children.
Note: To get the unique ID of a package, you can drag the package onto the TQL editing window, at which point you will prompted with a number of suggestions including "AllPackages", which you can then choose to add to your query.