What if you stored it in a seperate string though? I mean looped through each node, use whatever property it is that returns the contents of the node AND the XML directly around it, then use the position of the node and the position of its parent to determine how many tabs out it should be, then tab it over that many, then store it in a seperate string and proceed to the next node?

What would the problem be with that?