src/main/java/com/rockagen/commons/util/XmlUtil.java
protected static void initXstream(XStream xstream, XAlias[] xAlias,
                                      XAliasField[] xAliasFields, XAliasAttribute[] xAliasAttributes,
                                      XOmitField[] xOmitFields,
                                      XImplicitCollection[] xImplicitCollection,
                                      XImmutableType[] xImmutableTypes, XConverter[] xConverters) {

        if (xOmitFields != null) {
            for (XOmitField xof : xOmitFields) {
                xstream.omitField(xof.classType, xof.fieldName);
            }
        }
        if (xImplicitCollection != null) {
            for (XImplicitCollection xic : xImplicitCollection) {
                xstream.addImplicitCollection(xic.ownerType, xic.fieldName,
                        xic.itemFieldName, xic.itemType);
            }
        }
        if (xImmutableTypes != null) {
            for (XImmutableType xit : xImmutableTypes) {
                xstream.addImmutableType(xit.type);
            }
        }
        if (xConverters != null) {
            for (XConverter xc : xConverters) {
                xstream.registerConverter(xc.converter, xc.priority);
            }
        }

        if (xAlias != null) {
            for (XAlias xa : xAlias) {
                xstream.alias(xa.aliasName, xa.classType);
            }
        }
        if (xAliasFields != null) {
            for (XAliasField xaf : xAliasFields) {
                xstream.aliasField(xaf.aliasName, xaf.fieldType, xaf.fieldName);
            }
        }
        if (xAliasAttributes != null) {
            for (XAliasAttribute xaa : xAliasAttributes) {
                xstream.useAttributeFor(xaa.attributeType, xaa.attributeName);
                xstream.aliasAttribute(xaa.attributeType, xaa.attributeName,
                        xaa.aliasName);
            }
        }

    }
protected static void initXstream(XStream xstream, XAlias[] xAlias,
                                      XAliasField[] xAliasFields, XAliasAttribute[] xAliasAttributes,
                                      XOmitField[] xOmitFields,
                                      XImplicitCollection[] xImplicitCollection,
                                      XImmutableType[] xImmutableTypes, XConverter[] xConverters) {

        if (xOmitFields != null) {
            for (XOmitField xof : xOmitFields) {
                xstream.omitField(xof.classType, xof.fieldName);
            }
        }
        if (xImplicitCollection != null) {
            for (XImplicitCollection xic : xImplicitCollection) {
                xstream.addImplicitCollection(xic.ownerType, xic.fieldName,
                        xic.itemFieldName, xic.itemType);
            }
        }
        if (xImmutableTypes != null) {
            for (XImmutableType xit : xImmutableTypes) {
                xstream.addImmutableType(xit.type);
            }
        }
        if (xConverters != null) {
            for (XConverter xc : xConverters) {
                xstream.registerConverter(xc.converter, xc.priority);
            }
        }

        if (xAlias != null) {
            for (XAlias xa : xAlias) {
                xstream.alias(xa.aliasName, xa.classType);
            }
        }
        if (xAliasFields != null) {
            for (XAliasField xaf : xAliasFields) {
                xstream.aliasField(xaf.aliasName, xaf.fieldType, xaf.fieldName);
            }
        }
        if (xAliasAttributes != null) {
            for (XAliasAttribute xaa : xAliasAttributes) {
                xstream.useAttributeFor(xaa.attributeType, xaa.attributeName);
                xstream.aliasAttribute(xaa.attributeType, xaa.attributeName,
                        xaa.aliasName);
            }
        }

    }
XStream Alias

@param xstream             {@link com.thoughtworks.xstream.XStream}
@param xAlias              {@link com.rockagen.commons.util.XmlUtil.XAlias}
@param xAliasFields        {@link com.rockagen.commons.util.XmlUtil.XAliasField}
@param xAliasAttributes    {@link com.rockagen.commons.util.XmlUtil.XAliasAttribute}
@param xOmitFields         {@link com.rockagen.commons.util.XmlUtil.XOmitField}
@param xImplicitCollection {@link com.rockagen.commons.util.XmlUtil.XImplicitCollection}
@param xImmutableTypes     {@link com.rockagen.commons.util.XmlUtil.XImmutableType}
@param xConverters         {@link com.rockagen.commons.util.XmlUtil.XConverter}