/**
 * XStream - One of the best Java and XML Framework around
 * http://codeoftheday.blogspot.com/2013/07/xstream-one-of-best-java-and-xml.html
 */
package smhumayun.codeoftheday.XStreamExample;

import com.thoughtworks.xstream.XStream;

import java.util.Date;

/**
 * Main Example class
 *
 * User: smhumayun
 * Date: 7/12/13
 * Time: 7:53 PM
 */
public class MainXStreamExample {

    public static void main(String[] args) {

        //Instantiate XStream
        XStream xstream = new XStream();

        //Instantiate and initialize any domain object of yours
        User user = new User(1, "Syed Muhammad Humayun", new Date(System.currentTimeMillis()));

        //Convert your domain object to XML instantly with a single statement call!
        System.out.println(xstream.toXML(user));

    }

}