How can I find team members with certain team roles with XPath?

Hi, I have a Team with various members and roles and want to filter the query result by the roles: Team > Team Member >> team_role -> Identity = shall be used as filter, e.g. filter all Team Managers >> related_id -> Identity -> shall be returned Since I need the whole team structure I do not want to filter for the team role in the AML query. This would require about 6 individual AML queries to get my entire team. I prefer to have one AML query that reads the Team structure and then filter the team_roles via Xpath. How can achieve this? I tried the following query but only were able to get the team_roles, but not the related alias Identities:
var inn = new Innovator();
var team_id ="1B8309534C5849579E3D3D63C49B0D73"; // Debug test team

var team = inn.newItem("Team", "get");
team.setAttribute("select", "keyed_name");
team.setID(team_id);
   
var teamMembers = inn.newItem("Team Identity", "get");
//teamMembers.setAttribute("select", "related_id(is_alias,keyed_name)");
//teamMembers.setAttribute("where", "team_role = '1C45DAD11C1C4699838DF1FDD0403FCA'"); // -> this filters a certain team role -> works
teamMembers.setAttribute("select", "related_id(is_alias,keyed_name), team_role(id)");

team.addRelationship(teamMembers);
    
team = team.apply();
if (team.isError()) {
	return aras.AlertError(err.description);
}

//var group =  team.getItemsByXPath("//Item[@type='Identity'][is_alias='1']"); // -> used when filtering a certain team role in the AML query -> works!
var projectManager =  team.getItemsByXPath("//Item[@type='Identity'][id=' /*id of team_role */ ']"); // <-returns team_role, but not the related_id
var projectManager =  team.getItemsByXPath("//Item[@type='Team Identity'][team_role=' /*id of team_role */ ']"); // <- don´t work
I get all Identities in my query result, so I think the main problem is my XPath query. But what could be missing? Thanks in advance for any help! Angela