In XPath, predicates are expressed using square brackets containing a condition, in the form element[child='value']. Since the configuration hierarchy is system/login/user, with each user node containing a <name> child (e.g., 'user1', 'user2') and a <uid> child, the correct way to select the uid belonging specifically to the user whose name is 'user2' is user[name='user2']/uid. This filters the set of <user> nodes to the one whose <name> equals 'user2', then retrieves its <uid> child value.
Community Discussion