In the case of the JUnit parser (I haven't tried the other parsers, nor setup a custom parser yet), the test is linked using the value in the <testcase ....... name="xxxxx" .......> in the XML.
FWIW -- We are actually post-processsing the XML file to update that, so it has the full name (including the contents of the <testcase ....... classname="yyyyy" .......>) rather than just the short name, because that is the way we have named them in our Zephyr test repository. It is a fairly simple transform - e.g. in PowerShell we use this snippet
# find all "testcase" nodes, and update the "name" part to include "classname" as well
# because that's how we named the test cases in the Zephyr Enterprise
$matchingNodes = $xml.SelectNodes("//testcase")
foreach ($node in $matchingNodes) {
$node.SetAttribute("name", $node.classname + "." + $node.name)
}