Ok, so I query the tree for attribute "manager" which is a DN, and pull
back 11,000 values.

First iteration is for-each through it, XPATH out the
$current-node/attr[@attr-name="manager"]/value/text() and build a second
nodeset of the list of DNs.

Then pass it through the ECMA that Father Ramon gave me to do unique()
testing...
importPackage(Packages.com.novell.xml.xpath);
importPackage(Packages.com.novell.xsl.util);
importClass(java.util.HashSet);

/** Create a NodeSet that eliminates nodes from the input nodeset with
duplicate string values
* @param {String} input the input NodeSet
* @type NodeSet
* @return a NodeSet that eliminates nodes from the input nodeset with
duplicate string values
*/
function unique(input)
{
// create the output node set
var nodeSet = new InsertionOrderNodeSet();

// create HashSet to keep track of duplicates
var set = new HashSet();

// loop through the Nodes in the NodeSet
for (var node = input.first(); node != null; node = input.next())
{
var value = Util.getXSLStringValue(node).toUpperCase();

if (!set.contains(value))
{
set.add(value);
nodeSet.add(node);
}
}
return nodeSet;
}

That took about 1 minute 47 seconds to reduce 11,000 nodes down to about
100 unique values.

The for-each loop to get the nodeset of just the DN values took close to
30 minutes to generate! Doh!

Could I do something like this:
MANAGER-QUERY is a nodeset with the results of a query token for manager
on all Users.

Then set local variable (nodeset) JUST-MANAGER-DN to XPATH
attr[@attr-name="manager"]/value/text()

would that work? (Like using it in the strip-xpath example Father Ramon
gave me, described at: http://www.novell.com/communities/node/5686 )

That would so cool!

And since I posted the unique() function again, I should post the
duplicate() function again as well, so anyone finding this post in a
search will have both...

/** Create a NodeSet that contains nodes from the input nodeset with
duplicate string values
* @param {String} input the input NodeSet
* @type NodeSet
* @return a NodeSet that contains only nodes from the input nodeset
with duplicate string values
*/
function duplicate(input)
{
// create the output node set
var nodeSet = new InsertionOrderNodeSet();

// create HashSet to keep track of duplicates
var set = new HashSet();

// loop through the Nodes in the NodeSet
for (var node = input.first(); node != null; node = input.next())
{
var value = Util.getXSLStringValue(node).toUpperCase();
if (set.contains(value))
{
nodeSet.add(node);
}
else
{
set.add(value);
}
}
return nodeSet;
}