CFBundleVersion looks like a version string
Find it with XPath
Test it with a regular expression: \d+\.\d+(\.\d+)?
Could use XPath 2.0, but not yet widely supported
public void testCFBundleVersionFormat()
throws XPathExpressionException {
String regex = "\\d+\\.\\d+(\\.\\d+)?";
String xpath = "//key[. = 'CFBundleVersion']/following-sibling::string[1]";
String version = (String) query.evaluate(xpath, plist, XPathConstants.STRING);
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(version);
assertTrue(matcher.matches());
}