A two part problem that I'll bang my head on overnight, and will either
resolve or hopefully find and answer here in the morning:

I'm assigning phones based on job code and location, for those phones that
require a specific extension. Some job codes get multiple extensions
available to them. So if someone is placed into a given job code, I have to
determine if there is an extension available at their location AND
simultaneously, if this is one of those jobs with more than one extension

If it is a multi extension job, I have to determine the next available phone
to assign, by testing all the matching extensions to see if they have an
owner assigned. No owner = available phone, and process continues. I have
all the logic for this except testing to determine whether the list of
potential phones contains 1 or more objects.

1. I need to query for a node set, and determine from the result if there
are 1 (and only one) or more than one nodes returned.

I imagine I have to query(I have that part resolved), return the node set
into one local variable (phoneDN), and then determine a count and if count
is greater than one, set a second local variable (multiPhone) to "true".
How does one determine a count fora node set? Is that necessary, or can all
this be accomplished in one step? If so, how?

2. If the node set is multiple, I further have to determine the first node
which does not have the "Owner" attribute available, making that node the DN
that I'll assign various attributes in subsequent rules. I assume I should
read back the "Owner" attribute as part of the initial nodeset for setting
"phoneDN." But then what is the correct way to seek, within the node set,
for the first node without an owner?