What I want is to achieve the equivalent to SQL "select distinct"
statement with the instance results from a query.

I recall Rob Rawson talking in a presentation at the last BrainShare
about presenting a distinct list like this in ECMAScript/UserApp. (which
reminds me, despite providing my email address, I never was sent the
promised Designer project with all the code demoed!!)

I've done some searching and couldn't find anything that describes how
to do this in DirXML.

So I tried to roll my own. The following test code worked in my limited
testing. Can anyone advise if there is a better/smarter way to do this?

Note: I'm only interested in the actual unique values of a returned
attribute (in my case the L attribute).

<do-set-local-variable name="queryResult" scope="policy">
<arg-match-attr name="CN">
<arg-value type="string">
<token-text xml:space="preserve">blah</token-text>
<token-text xml:space="preserve">L</token-text>
expression='$queryResult//value[ancestor::*/@attr-name="L"][not( .=
.../../preceding-sibling::*//value[ancestor::*/@attr-name="L"]) ]/text()'/>
<token-local-variable name="current-node"/>