public static Element toXml(Object src) throws IllegalAccessException {

        Class cl = src.getClass();
        for (Annotation a : cl.getDeclaredAnnotations())
            java.lang.System.out.print("xml name: " + ((XMLFields) a).name());
        java.lang.System.out.println(" {");
        for (Field f : cl.getDeclaredFields()) {
            for (Annotation a : f.getDeclaredAnnotations()){
                if (f.get(src) instanceof Event){
                    java.lang.System.out.print(((XMLFields) a).name());
                    toXml(f.get(src));
                } else
                    java.lang.System.out.println(((XMLFields) a).name() + " = " + f.get(src));
            }
        }
        java.lang.System.out.println("}");
        return null;
    }