String saxParserClassName = System.getProperty("org.xml.sax.driver");
String version = System.getProperty("java.version");
if (enc == null || temp == null) {
temp = new ByteArrayOutputStream();
enc = new XMLEncoder(temp);
}
enc.writeObject(obj);
enc.close();
byte bytes[] = temp.toByteArray();
xml = new InputStreamReader(new ByteArrayInputStream(bytes), "UTF-8");