NVPair[] headers = new NVPair[2];
headers[0] = new NVPair(HttpHeaders.CONTENT_TYPE, "text/xml; charset='utf-8'");
headers[1] = new NVPair(HttpHeaders.CONTENT_LENGTH, Integer.toString(xmlBody.length()));
HTTPResponse response = ExtensionMethod("LOCK", workspacePath + nodeName, xmlBody.getBytes(), headers);
response.getStatusCode();
StringBuffer resp = new StringBuffer(new String(response.getData(), "UTF-8"));
final String lockPrffix = "opaquelocktoken:";
int pos = resp.lastIndexOf(lockPrffix);