Greetings,<BR><BR>I am a rookie at programming, and am diving into Dynamic Data Structures on the web primarily for Portfolio purposes...I NEED A JOB!!<BR><BR>Displaying part of my web site in a Tree View type display, I ran across a little problem. That is, how to populate My XML DOMDocument with many tier...<BR><BR>Here is code snipet from a small forum...<BR><BR>&#039;**************************** *******************<BR><BR> Do While not rs_posts.eof<BR> <BR> if rs_posts("ArticleNo") &#060;&#062; 0 AND ctr &#060;= 20 then<BR><BR> ttl = rs_posts("ArticleTitle")<BR> ttlf = Replace(ttl, "~", "&#039;")<BR><BR> set postNode = objDocument.createElement("article")<BR> postNode.setAttribute("type") = "folder"<BR> postNode.setAttribute("value") = ttlf<BR> postNode.setAttribute("url") = "" & rs_posts(0)<BR><BR> sq1 = "SELECT * FROM posts WHERE ArticleRef = " & rs_posts(0)<BR> set rs1 = conn1.execute(sq1)<BR><BR> Do While Not rs1.eof<BR><BR> If rs1("ArticleNo") = 0 And rs1("ToNo") = 0 Then<BR> <BR> set replyNode = objDocument.createElement("post")<BR> replyNode.setAttribute("type") = "folder"<BR> replyNode.setAttribute("value") = rs1("From")<BR> replyNode.setAttribute("url") = "" & rs1("PostNo") <BR><BR> sq2 = "SELECT * FROM posts WHERE ArticleRef = " & rs_posts(0)<BR> set rs2 = conn1.execute(sq2)<BR><BR> Do While Not rs2.eof<BR><BR> If rs2("ArticleNo") = 0 And rs2("ToNo") = rs1("ReplyNo") Then<BR> <BR> set rtrNode = objDocument.createElement("replytoreply")<BR> rtrNode.setAttribute("type") = "folder"<BR> rtrNode.setAttribute("value") = rs2("From")<BR> rtrNode.setAttribute("url") = "" & rs2("PostNo")<BR> <BR> replyNode.appendChild rtrNode <BR><BR> end if<BR><BR> rs2.movenext<BR> loop<BR><BR> <BR> postNode.appendChild replyNode<BR> <BR> end if<BR> <BR> rs1.movenext<BR> loop<BR><BR> <BR> articleNode.appendChild postNode &#039;Attach the new node to its parent<BR><BR> ctr = ctr + 1<BR> <BR> End If<BR> <BR> rs_posts.movenext<BR> <BR> loop<BR> <BR> end if<BR><BR> rs_posts.close<BR> set rs_posts = nothing<BR> rs1.close<BR> set rs1 = nothing<BR> rs2.close<BR> set rs2 = nothing<BR><BR>"********************************** **********<BR><BR>This, appears to me to be very resourcefull, thus in-efficient. How would you all suggest I populate this XML Document with the appropriate Nodes for, what if I get two members of my forum chatting back and forth 17 times on one I need to place a 20 tier nested Do while like the three nested above? There has got to be a simpler way.<BR><BR>Here is the start of it...<BR><BR><BR><BR>BTW...Portions of this code compliments of Your article writer Renoso<BR><BR>Thanks in advance,<BR><BR>Tim