class XMLInputSplitter {

	public Map<String, String> execute(Map<String, Object> inputMap)
			throws JDOMException, IOException {
		Map<String, String> result = new HashMap<String, String>();
		Element outputElement = (this.typeDescriptor.getName().length() > 0 ? new Element(
				this.typeDescriptor.getName())
				: new Element(this.typeDescriptor.getType()));

		if (typeDescriptor instanceof ComplexTypeDescriptor) {
			executeForComplexType(inputMap, result, outputElement);

		} else {
			for (String key : inputMap.keySet()) {
				Object dataObject = inputMap.get(key);

				if (dataObject instanceof List) {
					Element dataElement = buildElementFromObject(key, "");
					for (Object dataItem : ((List<?>) dataObject)) {
						Element itemElement = buildElementFromObject(key,
								dataItem);
						dataElement.addContent(itemElement);
					}

					XMLOutputter outputter = new XMLOutputter();
					String xmlText = outputter.outputString(dataElement);

					result.put(outputNames[0], xmlText);
				} else {
					Element dataElement = buildElementFromObject(key,
							dataObject);
					outputElement.addContent(dataElement);
					XMLOutputter outputter = new XMLOutputter();
					String xmlText = outputter.outputString(outputElement);
					result.put(outputNames[0], xmlText);
				}

			}
		}

		return result;

	}

	public  XMLInputSplitter(TypeDescriptor typeDescriptor, String inputNames[],
			String inputTypes[], String[] outputNames);

}