When is C(X)P a valuation ring for every prime ideal P