This XPath expression will find a product if it is is stock and return no items if it's not.
$items = $xml->xpath( "/ STOREITEMS / PRODUCT [ @ITEM = '$product_queried' and STOCK / text() = 'In Stock' ] " );
Regards,
Phill W.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.