class XAnnotatedList extends XAnnotatedMember {

    protected static final ElementVisitor        elementListVisitor = new ElementVisitor();
    protected static final ElementValueVisitor   elementVisitor     = new ElementValueVisitor();
    protected static final AttributeValueVisitor attributeVisitor   = new AttributeValueVisitor();

    // indicates the type of the collection components
    public Class<?>                              componentType;

    protected XAnnotatedList(XMap xmap, XSetter setter, XGetter getter) {
        super(xmap, setter, getter);
    }

    public XAnnotatedList(XMap xmap, XSetter setter, XGetter getter, XNodeList anno) {
        super(xmap, setter, getter);
        path = new Path(anno.value());
        trim = anno.trim();
        type = anno.type();
        cdata = anno.cdata();
        componentType = anno.componentType();
        valueFactory = xmap.getValueFactory(componentType);
        xao = xmap.register(componentType);
    }

    @SuppressWarnings("unchecked")
    @Override
    protected Object getValue(Context ctx, Element base) throws Exception {
        ArrayList<Object> values = new ArrayList<Object>();
        if (xao != null) {
            DOMHelper.visitNodes(ctx, this, base, path, elementListVisitor, values);
        } else {
            if (path.attribute != null) {
                // attribute list
                DOMHelper.visitNodes(ctx, this, base, path, attributeVisitor, values);
            } else {
                // element list
                DOMHelper.visitNodes(ctx, this, base, path, elementVisitor, values);
            }
        }

        if (type != ArrayList.class) {
            if (type.isArray()) {
                if (componentType.isPrimitive()) {
                    // primitive arrays cannot be cast to Object[]
                    return PrimitiveArrays.toPrimitiveArray(values, componentType);
                } else {
                    return values
                        .toArray((Object[]) Array.newInstance(componentType, values.size()));
                }
            } else {
                Collection col = (Collection) type.newInstance();
                col.addAll(values);
                return col;
            }
        }

        return values;
    }

    @SuppressWarnings("unchecked")
    public void decode(Object instance, Node base, Document document, List<String> filters)
                                                                                           throws Exception {<FILL_FUNCTION_BODY>}
}

        if (!isFilter(filters)) {
            return;
        }

        Collection col = null;
        if (Collection.class.isAssignableFrom(type)) {
            col = (Collection) getter.getValue(instance);
        } else {
            if (type.isArray()) {
                col = new ArrayList();

                Object obj = getter.getValue(instance);

                int length = Array.getLength(obj);

                for (int i = 0; i < length; i++) {
                    col.add(Array.get(obj, i));
                }
            } else {
                throw new Exception("@XNodeList " + base.getNodeName()
                                    + " 'type' only support Collection ande Array type");
            }
        }

        Node node = base;
        int len = path.segments.length - 1;
        for (int i = 0; i < len; i++) {
            Node n = DOMHelper.getElementNode(node, path.segments[i]);
            if (n == null) {
                Element element = document.createElement(path.segments[i]);
                node = node.appendChild(element);
            } else {
                node = n;
            }
        }

        String name = path.segments[len];

        Node lastParentNode = node;

        for (Object object : col) {

            Element element = document.createElement(name);
            node = lastParentNode.appendChild(element);

            if (xao != null) {
                xao.decode(object, node, document, filters);
            } else {
                String value = object == null ? "" : object.toString();

                if (path.attribute != null && path.attribute.length() > 0) {
                    Attr attr = document.createAttribute(path.attribute);
                    attr.setNodeValue(value);

                    ((Element) node).setAttributeNode(attr);
                } else {
                    if (cdata) {
                        CDATASection cdataSection = document.createCDATASection(value);
                        node.appendChild(cdataSection);
                    } else {
                        node.setTextContent(value);
                    }
                }
            }
        }

    
<methods>public void <init>(com.alipay.sofa.common.xmap.XMap, com.alipay.sofa.common.xmap.XSetter, com.alipay.sofa.common.xmap.XGetter, com.alipay.sofa.common.xmap.annotation.XNode) ,public void decode(java.lang.Object, org.w3c.dom.Node, org.w3c.dom.Document, List<java.lang.String>) throws java.lang.Exception,public void process(com.alipay.sofa.common.xmap.Context, org.w3c.dom.Element) throws java.lang.Exception,public void process(com.alipay.sofa.common.xmap.Context, Map<java.lang.String,java.lang.Object>, java.lang.String) throws java.lang.Exception<variables>public boolean cdata,public final non-sealed com.alipay.sofa.common.xmap.XGetter getter,public com.alipay.sofa.common.xmap.Path path,public final non-sealed com.alipay.sofa.common.xmap.XSetter setter,public boolean trim,public Class#RAW type,public com.alipay.sofa.common.xmap.XValueFactory valueFactory,public com.alipay.sofa.common.xmap.XAnnotatedObject xao,public final non-sealed com.alipay.sofa.common.xmap.XMap xmap