Perturbatio #1 Need to remove the two DebugLog statements from the end of the GetXMLLevel function as it causes a crash when you reach the last level.