Have found a solution for this if anyone else is interested.
Basically I wrote a short function to dump the innerHTML values into an array. Once I have put the node where it needs to go I can call the reverse operation which using the array resets the innerHTML values.
function
backupVals(node, arr) {
arr[arr.length] = node.get_textElement().innerHTML;
for (idx = 0; idx < node.get_nodes().get_count(); idx++) {
backupVals(node.get_nodes().getNode(idx), arr);
}
}
function
restoreVals(node, arr) {
node.get_textElement().innerHTML = arr[0];
for (idx = 0; idx < node.get_nodes().get_count(); idx++) {
restoreVals(node.get_nodes().getNode(idx), arr.slice(1));
}
}
var
newNode = new Telerik.Web.UI.RadTreeNode();
parent.get_nodes().add(newNode);
while (parent.get_nodes().get_count() > 1) {
var currentNode = parent.get_nodes().getNode(0);
var tempVals = new Array();
backupVals(currentNode, tempVals);
parent.get_nodes().remove(currentNode);
newNode.get_nodes().add(currentNode);
restoreVals(currentNode, tempVals);
}