DOMSerializer serializer = new DOMSerializer(writer, parent.properties);
serializer.setOutputProperties(parent.properties); serializer.setWriter(writer);
	public Object getContent() throws XMLDBException {		if (content != null)			return content;		else if (root != null) {			try {				StringWriter writer = new StringWriter();				DOMSerializer serializer = new DOMSerializer(writer, parent.properties);				serializer.serialize(root);				content = writer.toString();			} catch (TransformerException e) {				throw new XMLDBException(ErrorCodes.INVALID_RESOURCE, e.getMessage(), e);			}			return content;		} else if (value != null) {			try {				return value.getStringValue();			} catch (XPathException e) {				throw new XMLDBException(ErrorCodes.INVALID_RESOURCE, e.getMessage(), e);			}		} else if (file != null) {			try {				content = XMLUtil.readFile(file);				return content;			} catch (IOException e) {				throw new XMLDBException(					ErrorCodes.VENDOR_ERROR,					"error while reading resource contents",					e);			}		} else {			DBBroker broker = null;			try {				broker = brokerPool.get(user);				if (document == null)					getDocument(broker);				if (!document.getPermissions().validate(user, Permission.READ))					throw new XMLDBException(						ErrorCodes.PERMISSION_DENIED,						"permission denied to read resource");				Serializer serializer = broker.getSerializer();				serializer.setUser(user);				serializer.setProperties(parent.properties);				if (id < 0)					content = serializer.serialize(document);				else {					if (proxy == null)						proxy = new NodeProxy(document, id);					content = serializer.serialize(proxy);				}				return content;			} catch (SAXException saxe) {				saxe.printStackTrace();				throw new XMLDBException(ErrorCodes.VENDOR_ERROR, saxe.getMessage(), saxe);			} catch (EXistException e) {				throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);			} catch (Exception e) {				e.printStackTrace();				throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);			} finally {				brokerPool.release(broker);			}		}	}