/** * Validates that an add of a single document results in success. * * @param fieldsAndValues Odds are field names, Evens are values * @return null if successful, otherwise the XML response to the update * @see #appendSimpleDoc */ public String validateAddDoc(String... fieldsAndValues) throws XPathExpressionException, SAXException, IOException { StringBuilder buf = new StringBuilder(); buf.append("<add>"); appendSimpleDoc(buf, fieldsAndValues); buf.append("</add>"); String res = update(buf.toString()); String valid = validateXPath(res, "//result[@status=0]" ); return (null == valid) ? null : res; }