class XAnnotatedObject {

    public final XMap            xmap;
    public final Class<?>        klass;
    public final Path            path;

    final List<XAnnotatedMember> members;

    Sorter                       sorter;

    Sorter                       deSorter;

    public XAnnotatedObject(XMap xmap, Class<?> klass, XObject xob) {
        this.xmap = xmap;
        this.klass = klass;
        path = new Path(xob.value());
        members = new ArrayList<>();
        String[] order = xob.order();
        if (order.length > 0) {
            sorter = new Sorter(order);
        }
    }

    public void addMember(XAnnotatedMember member) {
        members.add(member);
    }

    public Path getPath() {
        return path;
    }

    public Object newInstance(Context ctx, Element element) throws Exception {<FILL_FUNCTION_BODY>}

    public Object newInstance(Context ctx, Map<String, Object> map, String keyPrefix)
                                                                                     throws Exception {
        Object ob = klass.newInstance();
        ctx.push(ob);

        // set annotated members
        for (XAnnotatedMember member : members) {
            member.process(ctx, map, keyPrefix);
        }

        return ctx.pop();
    }

    public void decode(Object instance, Node base, Document document, List<String> filters)
                                                                                           throws Exception {

        Node node = base;
        String name = path.path;

        if (sorter != null) {
            deSorter = sorter;
        }

        if (deSorter != null) {
            Collections.sort(members, deSorter);
            deSorter = null; // sort only once
        }

        if (name != null && name.length() > 0) {
            Element element = document.createElement(name);
            node = node.appendChild(element);
        }

        for (XAnnotatedMember annotatedMember : members) {
            annotatedMember.decode(instance, node, document, filters);
        }
    }
}

        Object ob = klass.newInstance();
        ctx.push(ob);

        if (sorter != null) {
            Collections.sort(members, sorter);
            deSorter = sorter;
            sorter = null; // sort only once
        }

        // set annotated members
        for (XAnnotatedMember member : members) {
            member.process(ctx, element);
        }

        return ctx.pop();
    
<no_super_class>