Hi Scripters. I am asking this here because I know there are some coding studs that hang out here. I posted a request for help on the FrameMaker ExtendScript forum, but the traffic there is pretty light. Here is the gist of what I am doing. I am recursively processing an XML document. I am keeping track of what "level" I am in in the XML structure. But I also want to keep track of the current level so I can see when the level changes, and in what direction. I can keep track of the level, but I am having a hard time keeping track of the previous level so I can correctly detect a change. I posted some sample code and an example XML file here.