The $result from the first XPATH pass is correct if all that is set is ‘photographer_id’ if I then try $result = $xml->xpath('/root/area[photographer_id="' . $photographer_id . '"] | /root/area[photographer="' . $photographer . '"]'); and select 1 and fred then I get the result of an array of all four when it should be an empty arrayhere is the XML file