class LdapSender extends JNDIBase implements ISenderWithParameters {

	private XmlBuilder getTree(DirContext parentContext, String context, IPipeLineSession session, Map paramValueMap)
	{
		XmlBuilder contextElem = new XmlBuilder("context");
		contextElem.addAttribute("name", context);
		
		String[] subCtxList = getSubContextList(parentContext, context, session);
		try	{
			if (subCtxList.length == 0) {
				XmlBuilder attrs = attributesToXml(parentContext.getAttributes(context, getAttributesReturnedParameter()));
				contextElem.addSubElement(attrs);
			}
			else {
				for (int i = 0; i < subCtxList.length; i++)
				{
					contextElem.addSubElement( getTree((DirContext)parentContext.lookup(context), subCtxList[i], session, paramValueMap) );
				}
				contextElem.addSubElement( attributesToXml(parentContext.getAttributes(context, getAttributesReturnedParameter())));
			}

		} catch (NamingException e) {
			storeLdapException(e, session);
			log.error("Exception in operation [" + getOperation()+ "]: ", e);
		}

		return contextElem;
	}

	public  LdapSender();

}