if (appResponse.getStatus().isSuccess() && (remaining==null || remaining.length()==0)) {
String path = request.getResourceRef().getPath();
path = path.substring(0,path.length()-1);
getLogger().info("Manipulating service document to adjust to path: "+path);
try {
XMLRepresentationParser parser = new XMLRepresentationParser();
Document introspection = parser.load(appResponse.getEntity());
Iterator<Element> workspaces = introspection.getDocumentElement().getElementsByName(WORKSPACE);
while (workspaces.hasNext()) {
Element workspace = workspaces.next();
Iterator<Element> collections = workspace.getElementsByName(COLLECTION);
while (collections.hasNext()) {