Let L be a fixed branch -that is, an irreducible germ of curve -on a normal surface singularity X. If A, B are two other branches, define uL(A, B) :where A · B denotes the intersection number of A and B. Call X arborescent if all the dual graphs of its good resolutions are trees. In a previous paper, the first three authors extended a 1985 theorem of P loski by proving that whenever X is arborescent, the function uL is an ultrametric on the set of branches on X different from L. In the present paper we prove that, conversely, if uL is an ultrametric, then X is arborescent. We also show that for any normal surface singularity, one may find arbitrarily large sets of branches on X, characterized uniquely in terms of the topology of the resolutions of their sum, in restriction to which uL is still an ultrametric. Moreover, we describe the associated tree in terms of the dual graphs of such resolutions. Then we extend our setting by allowing L to be an arbitrary semivaluation on X and by defining uL on a suitable space of semivaluations. We prove that any such function is again an ultrametric if and only if X is arborescent, and without any restriction on X we exhibit special subspaces of the space of semivaluations in restriction to which uL is still an ultrametric.