	public synchronized void addJaxbPackages(List<String> packageList) { 
		if (packagesContextPath.length()==0) {
		}
		StringBuilder contextPath = new StringBuilder(packagesContextPath);
		for (String pack : packageList)
			contextPath.append(":" + pack);
		try {
			for (int i=0; i<packageList.size(); i++) {
				String packageStr = packageList.get(i);
				String nsStr = getNSfromPackage(packageStr);
				nsToPackage.put(nsStr, packageStr);
			}	
		}
		catch (Exception ex) {
			LOG.error("Error in JAXBMapping adding: " + ex.getMessage());
		}
		packagesContextPath = contextPath.toString();
	}
	private String getNSfromPackage(String packageString) {
		String ns = "";
		String[] packArr = packageString.split("\\.");
		ns = "http://" + packArr[1] + "." + packArr[0];
		for(int i=2; i<packArr.length; i++)
			ns+="/" + packArr[i]; 
		return ns;
	}
	@Override
	public void addSimpleClasses(List<String> classList) throws ClassNotFoundException {
		for (String c : classList) {
			Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(c);
			Root rootAnnotation = clazz.getAnnotation(Root.class);
			Namespace namespaceAnnotation = clazz.getAnnotation(Namespace.class);
			if (rootAnnotation!=null && namespaceAnnotation!=null) {
				elementToClass.put("{"+namespaceAnnotation.reference()+"}"+rootAnnotation.name(),clazz);
			}
		}
	}
}

	public synchronized void addJaxbPackages(List<String> packageList) { 
		if (packagesContextPath.length()==0) {
		}
		StringBuilder contextPath = new StringBuilder(packagesContextPath);
		for (String pack : packageList)
			contextPath.append(":" + pack);
		try {
			for (int i=0; i<packageList.size(); i++) {
				String packageStr = packageList.get(i);
				String nsStr = getNSfromPackage(packageStr);
				nsToPackage.put(nsStr, packageStr);
			}	
		}
		catch (Exception ex) {
			LOG.error("Error in JAXBMapping adding: " + ex.getMessage());
		}
		packagesContextPath = contextPath.toString();
	}
	private String getNSfromPackage(String packageString) {
		String ns = "";
		String[] packArr = packageString.split("\\.");
		ns = "http://" + packArr[1] + "." + packArr[0];
		for(int i=2; i<packArr.length; i++)
			ns+="/" + packArr[i]; 
		return ns;
	}
	@Override
	public void addSimpleClasses(List<String> classList) throws ClassNotFoundException {
		ClassLoader cl = Thread.currentThread().getContextClassLoader();
		try {
			for (String c : classList) {
				Class<?> clazz = cl.loadClass(c);
				Root rootAnnotation = clazz.getAnnotation(Root.class);
				Namespace namespaceAnnotation = clazz.getAnnotation(Namespace.class);
				if (rootAnnotation!=null && namespaceAnnotation!=null) {
					elementToClass.put("{"+namespaceAnnotation.reference()+"}"+rootAnnotation.name(),clazz);
				}
			}
		} catch (ClassNotFoundException e) {
			throw new ClassNotFoundException("Unable to load class using classloader "+cl.toString(), e);
		}
	}
}
