Doesn't make sense.
You are in an INFINITE LOOP there.
Code:
while n.hasChildNodes
You never break out of that loop and you never change the value of n inside the loop.
Also, since you are using recursion you *MUST* DIM each of the variables that are local to each occurrence of the recursion INSIDE the SUB.
That would mean
Code:
Sub Drill(n)
Dim chd, cld1, att
...
Finally, you are not checking to be sure that some of those values *exist* before you use them! For example, you do
Code:
for each att in cld1.attributes
But you *WILL* get an error if
cld1 doesn't HAVE any attributes!