Getting all first child elements of an element

Hi there,
I’m trying to get all first child elements of an element (read: only child, no grandchild). What I first thought it is working is like this:

List tempElements = driver.getDriver().findElements(By.xpath(“.//child::” + idOfPartent + “/*”))

… but i guess this is not the correct way, because sometimes I get more child elements than really exist. What is the correct way to do this?

Found a solution.
The problem was, that when scrolled down the feed, new elements were displayed and some of them had another RecyclerView inside and since I was searching by class name, both recycleViewers were found.

What I did was to search by resource-id and not by class name:

List tempElements = driver.getDriver().findElements(By.xpath(“.//*[@resource-id='” + idOfRecyclerView + "']/child:: * "));