The SelectDistinct function allows you to return only one value from duplicate values. The same values must be in the same document. Otherwise, use SelectDistinctValues.
Note: Attributes to be filtered are without @, see example!
SelectDistinct('Node/SubNode', 'Attribut', 'SortAttribute')