Hi

I've been trying to add some sort of Xpath to sort my XML with PHP, seems to be returning the correct amount of elements based on the criteria, but now no values are showing. No hotel name, no img, just empty div containers.

Can anybody spot what is causing the empty values, what am I doing wrong?

PHP Code:
<?php $i=1; foreach ($hotels->hotel->xpath('//hotel/location[. ="some location"]') as $hotel): ?>
              <?php $clss= ($i == 0)? 'class="last"':'' ?>
              <div <?php echo $clss ?> >
                    <img src="images/<? echo $hotel->img->name ?>">
                    <h3><?php echo $hotel->name ?></h3>
                    <p><?php echo $hotel->description ?></p>
                    <p><b>Rating:</b> <?php echo $hotel->star ?></p>
                    <p><b>Location:</b> <?php echo $hotel->location ?></p>
            </div>
            <? $i++;?>
            <? endforeach ?>
If I use the below everything works ok but no Xpath sorting.

PHP Code:
<?php $i=1; foreach ($hotels->hotel as $hotel): ?>

Barry