Simple XML - getting the next result

Hi.

I am using this line of php to get the first result from my xml file


$results -> OrderInfo -> LineItems -> LineItemInfo[0] -> Sku

how do I then get the next LineItemInfo? Is it a case of counting the LineItemInfo and then looping or is there a simpler way.

If I need to count the occurrences of LineItemInfo - how do I do that? I cant find any simpleXml command to do that!

Thanks
Chris

Just a quick update!

I’m now using a for-each loop to try and get the results, but all I am returning is a blank screen, no error message - however I am echoing a lot of non breaking spaces!


foreach($results -> OrderInfo -> LineItems -> LineItemInfo[$pointer] as $item) 
	{
		//echo "<pre>";
		//print_r($item);
		//echo "</pre>";
		$z .= $item -> Sku . "<br/>";
		$pointer++;
	}