title: Save an object to XML format or with serialization?
body: <p>I am developing an application in Java, where I have some classes, like <code>Person</code> and <code>Company</code>. All these classes have some instances e.g.</p>
  
  <pre><code>public class Person{
        private String firstName;
        private String lastName;
        private String mail;
  
       //more code..
  }
  </code></pre>
  
  <p>So in some point I create an Object type of Person, which I want to save it for future use. I am new to this, so I have this question. Should I use Object serialization or should I save it in XML format? I realize that an XML format has its advantages that's why I am asking (If I want to save it in XML format, I use <code>XMLEncoder</code>class right?) Which one should I use?</p>