class XMLWorker implements XMLParserListener {

	public void endElement(final String tag, final String ns) {
		String thetag = null;
		if (parseHtml) {
			thetag = tag.toLowerCase();
		} else {
			thetag = tag;
		}
		WorkerContext ctx = getLocalWC();
		if (null != ctx.getCurrentTag() && !thetag.equals(ctx.getCurrentTag().getName())) {
			throw new RuntimeWorkerException(String.format(
					LocaleMessages.getInstance().getMessage(LocaleMessages.INVALID_NESTED_TAG), thetag,
					ctx.getCurrentTag().getName()));
		}
		Pipeline<?> wp = rootpPipe;
		ProcessObject po = new ProcessObject();
		try {
			while (null != (wp = wp.close(ctx, ctx.getCurrentTag(), po)))
				;
		} catch (PipelineException e) {
			throw new RuntimeWorkerException(e);
		} finally {
			if (null != ctx.getCurrentTag())
				ctx.setCurrentTag(ctx.getCurrentTag().getParent());
		}
	}

	public  XMLWorker(final Pipeline<?> pipeline, final boolean parseHtml);

}