Conditional for paging

I just need a condition for paging in an XML gallery where i get a server response.
Whenever there is a new records to load, server gives me the xml tag np (stands for next page) and then a next arrow appears on stage to load the new records when clicked.

The thing is I need a condition that will secure my paging when the records are over and there will be only pp in my XML file - where pp stands for previous page. I mean I don’t want when the user goes to last page the next arrow to be active or present on stage…

So far my code


if ("np" in myXML)
	{
		addChild(_Rarrow);
		_Rarrow.buttonMode = true;
		_Rarrow.x = gal_back.width + 40;
		_Rarrow.y = gal_back.height / 2;
		_Rarrow.addEventListener(MouseEvent.CLICK, navigateToRight);		
	   }	
if ("pp" in myXML)
	{
		addChild(_Larrow);
		_Larrow.buttonMode = true;
		_Larrow.rotation = 180;
		_Larrow.x = thumbsHolder.x - 30;
		_Larrow.y = gal_back.height / 2;
		_Larrow.addEventListener(MouseEvent.CLICK, navigateToLeft);
}

– Actually i need sthg like

If ("pp" doesn't exist in my XML) 
{
 remove right arrow from stage

}