The function takes a single parameter which is sequence of XML entities (nodes or values) and returns the sequence that results from removing from input sequence all but one of a set of elements that are identical each other. If input sequence is the empty, the empty sequence is returned.
Note that the distinct is not a part of XPATH 1.0 or XQuery 1.0 standard library, it is rather a generalization of standard distinct-nodes and distinct-values functions.
Sequence