throws java.rmi.RemoteException { Session session = getSession(sessionId); DBBroker broker = null; try { broker = pool.get(session.getUser()); DocumentImpl document = (DocumentImpl) broker.getDocument(name); if (document == null) throw new RemoteException("resource " + name + " not found"); Serializer serializer = broker.getSerializer(); serializer.reset(); serializer.setProperty(EXistOutputKeys.EXPAND_XINCLUDES, xinclude ? "yes" : "no"); serializer.setProperty(OutputKeys.INDENT, indent ? "yes" : "no"); return serializer.serialize(document);          } catch (SAXException saxe) { saxe.printStackTrace(); throw new RemoteException(saxe.getMessage()); } catch (EXistException e) { throw new RemoteException(e.getMessage()); } catch (PermissionDeniedException e) { throw new RemoteException(e.getMessage()); } finally { pool.release(broker); }
throws java.rmi.RemoteException { Properties outputProperties = new Properties(); outputProperties.setProperty(OutputKeys.INDENT, indent ? "yes" : "no"); outputProperties.setProperty(EXistOutputKeys.EXPAND_XINCLUDES, xinclude ? "yes" : "no"); return getResource(sessionId, name, outputProperties);
	public String getResource(String sessionId, String name, boolean indent, boolean xinclude)		throws java.rmi.RemoteException {		Session session = getSession(sessionId);		DBBroker broker = null;		try {			broker = pool.get(session.getUser());			DocumentImpl document = (DocumentImpl) broker.getDocument(name);			if (document == null)				throw new RemoteException("resource " + name + " not found");			Serializer serializer = broker.getSerializer();			serializer.reset();			serializer.setProperty(EXistOutputKeys.EXPAND_XINCLUDES, xinclude ? "yes" : "no");			serializer.setProperty(OutputKeys.INDENT, indent ? "yes" : "no");			return serializer.serialize(document);			//			if (xml != null)			//				try {			//					return xml.getBytes("UTF-8");			//				} catch (java.io.UnsupportedEncodingException e) {			//					return xml.getBytes();			//				}			//			//			return null;		} catch (SAXException saxe) {			saxe.printStackTrace();			throw new RemoteException(saxe.getMessage());		} catch (EXistException e) {			throw new RemoteException(e.getMessage());		} catch (PermissionDeniedException e) {			throw new RemoteException(e.getMessage());		} finally {			pool.release(broker);		}	}