String content = '<?xml version="1.0" encoding="UTF-8"?>
';Element element = null;
ByteArrayInputStream tInputStringStream = null;
try {
tInputStringStream = new ByteArrayInputStream(content.getBytes());
SAXBuilder builder = new SAXBuilder(false);
Document doc = builder.build(tInputStringStream);
element = doc.getRootElement();
} catch (Exception jdome) {
jdome.printStackTrace();
} finally {
if (tInputStringStream != null) {
try {
tInputStringStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}