**Setup**

* I have three objects: `X`, `Y`, and `Z`.
* `X` (child) has master-detail relationship to `Y` (parent).
* `Z` (child) has a lookup relationship to `Y` (parent).

**Question**

How do I retrieve records from object `X` which are also related to object `Z` with `Y`? That is, results from `X` having common entry in `Y`.