Extend ElementQuery to support non-recursive searches

Change-Id: I78a3f48a8828296c603c4fb36512e8d090e879b8