src/main/java/com/rockagen/commons/util/XmlUtil.java
public static Object toBean(String xmlStr, XAlias[] xAlias,
                                XAliasField[] xAliasFields, XAliasAttribute[] xAliasAttributes,
                                XOmitField[] xOmitFields) {
        return toBean(xmlStr, xAlias, xAliasFields, xAliasAttributes,
                xOmitFields, null, null, null);
    }
public static Object toBean(String xmlStr, XAlias[] xAlias,
                                XAliasField[] xAliasFields, XAliasAttribute[] xAliasAttributes,
                                XOmitField[] xOmitFields) {
        return toBean(xmlStr, xAlias, xAliasFields, xAliasAttributes,
                xOmitFields, null, null, null);
    }
Bean to xml.
<p>
Using XStream library from xml to serialize objects.
</p>
example:
<pre>
XAlias[] xa={new XAlias("Foo",Foo.class)};
XAliasField[] xaf={new XAliasField("Bar",Bar.class,"bar")};
XAliasAttribute[] xaa={new XAliasAttribute("Name",User.class,"name")};
XOmitField[] xf={new XOmitField(V.class,"v")}

then,
*
toBean(xmlStr,xa,xaf,xaa,xf);
</pre> <b>Note: XStream Mode is {@link XStream#NO_REFERENCES}</b>

@param xmlStr           xml String
xml String
@param xAlias           Alias a Class to a shorter name to be used in XML elements.
@param xAliasFields     Create an alias for a field name.
@param xAliasAttributes Create an alias for an attribute.
@param xOmitFields      Prevents a field from being serialized.
@return Object
@since XSTREAM 1.4.5