Fix up result of selectNodes

Exclude empty selections in unwrapped nodes.

Bug: 60117
Change-Id: Ifa2ed0c1d315d78fdf7fbb6d13fca37e19445b1e