code: @SuppressWarnings("rawtypes")
  	public static Object toObject(File file, String encoding, Class<Map> cls) throws UnmarshalException, NoSuchPathException {
  		
  		if (file == null || !file.exists()) {
  			throw new NoSuchPathException("Could not find file");
  		} 
  		if (file.isDirectory()) {
  			throw new NoSuchPathException(String.format("%s is Directory", file.getAbsolutePath()));
  		}
  		
  		Object object = null;
  		
  		Unmarshaller bind = new XmlUnmarshaller(new ResourceReader().getFileStream(file, encoding));
  		bind.setRootClass(cls);
  		object = bind.unmarshal();
  
  
  		return object;
  	}
docs: 将XML文件绑定为对象
  
  @param file XML文件
  @param encoding XML文件编码, 例如UTF-8, GBK
  @param cls 绑定目标类
  
  @return 绑定后的对象
  
  @throws NoSuchPathException 路径异常
  @throws UnmarshalException 解组异常