The code stores the xml data locally and when attempting to get the new page, it can't as the value of $xml is not null (as it has previously been saved from another page). A simple fix would be to store the current page as a class variable and compare the one in the method's parameters to the one stored in the class.
The code stores the xml data locally and when attempting to get the new page, it can't as the value of $xml is not null (as it has previously been saved from another page). A simple fix would be to store the current page as a class variable and compare the one in the method's parameters to the one stored in the class.