XPath is not Turing complete.
Some things are easier (or possible) if you don't do them in pure XPath.
Use XPath to select the relevant element" //key[. = 'CFBundleVersion']/following-sibling::string[1]
//key[. = 'CFBundleVersion']/following-sibling::string[1]
Then test its value with Java.