How works {XOR} constraint in UML?
<p>I have some doubts about how correctly we can use {XOR} constraint in UML. </p>

<p><a href="https://i.stack.imgur.com/do834.png" rel="noreferrer"><img src="https://i.stack.imgur.com/do834.png" alt="enter image description here"></a></p>

<p>I understand how it works in two different ways. Which one is correct?</p>

<ol>
<li><p>The xor constraint applies to the association. (either: an object of type A may be associated with 1 object of type C; or: an object of type A may be associated with zero or 1 object to type B; or: object A could be just by itself because we have [0..1] near B).</p></li>
<li><p>The xor constraint applies to the link (either: an object of type A must be associated with exactly one object of type C; or: an object of type A must be associated to exactly one object of type B). </p></li>
</ol>