def METHOD_NAME(self, parent, newParent):
    # main loop - iterating over item's children
    item, cookie = self.GetFirstChild(parent)
    while item:
        itemName = self.GetItemText(item)
        itemData = self.GetItemData(item)
        newItem = self.AppendItem(newParent, itemName)
        self.SetItemPyData(newItem, itemData)
        # if an item had children, we need to re-parent them as well
        if self.ItemHasChildren(item):
            # recursing...
            self.METHOD_NAME(item, newItem, )
        # continue iteration to the next child
        item, cookie = self.GetNextChild(parent, cookie)