if (requestedProps == null || requestedProps.contains(DavElements.E_RESOURCETYPE)) rs.addResourceTypeElement(findPropstat(resp, propstatMap, STATUS_OK), nameOnly);
	private void addResourceToResponse(DavContext ctxt, DavResource rs, Element top, boolean nameOnly, Set<QName> requestedProps, boolean includeChildren) throws DavException {		Element resp = top.addElement(DavElements.E_RESPONSE);		resp.addElement(DavElements.E_HREF).setText(UrlNamespace.getResourceUrl(rs));		Map<Integer,Element> propstatMap = new HashMap<Integer,Element>();		Set<QName> propNames;		if (requestedProps == null)			propNames = rs.getAllPropertyNames();		else			propNames = requestedProps;		if (requestedProps == null || requestedProps.contains(DavElements.E_RESOURCETYPE))			rs.addResourceTypeElement(findPropstat(resp, propstatMap, STATUS_OK), nameOnly);		for (QName name : propNames) {			if (name.equals(DavElements.E_RESOURCETYPE))				continue;			Element propstat = findPropstat(resp, propstatMap, HttpServletResponse.SC_OK);			Element e = rs.addPropertyElement(propstat, name, nameOnly);			if (e == null) {				Element error = findPropstat(resp, propstatMap, HttpServletResponse.SC_NOT_FOUND);				error.addElement(name);				continue;			}		}		if (rs.isCollection() && includeChildren) {			List<DavResource> children = rs.getChildren(ctxt);			for (DavResource child : children)				addResourceToResponse(ctxt, child, top, nameOnly, requestedProps, includeChildren);		}	}