title: XMLEncoder in java for serialization
body: <p>Im just wondering how i use <a href="http://download.oracle.com/javase/6/docs/api/java/beans/XMLEncoder.html" rel="noreferrer"><code>XMLEncoder</code></a> to serialize <code>ArrayList&lt;foo&gt;</code> where foo is my own made class. </p>
  
  <p>Do i have to do anything in particular, ie define my own xml structure first and then call toString on each value in my list and write it out?</p>
  
  <p>Can anyone point me to a good tutorial? <a href="http://java.sun.com/products/jfc/tsc/articles/persistence4/" rel="noreferrer">http://java.sun.com/products/jfc/tsc/articles/persistence4/</a> Thats what i have been looking at but it doesnt seem to mention what to do with non library classes. </p>
  
  <p>Thanks</p>