Patrick thanks again. I already tried something similar and I am running into a problem with duplicate or identical pages and the current selected page. Your code did give me another idea but it still does not address the issue with identical pages. That is where I am getting stuck. Here is an example:
It looks like this
---------------------
Page 1
Page 2
Page 3 (resides in wiki 1)
Page Child 1 (wiki 1)
Page 3 (resides in wiki 2)
Page Child 1 (wiki 2)
Page Child 1 Child (selected, wiki 2)
Page 4
I need to merge both Page 3 and their kids into 1.
I want this:
---------------
Page 1
Page 2
Page 3 (resides in wiki 1)
Page Child 1
Page Child 1 Child (selected, wiki 2)
Page 4