Java version of Auto-XML