import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; import java.io.File; import org.xml.sax.SAXException; public class Main { public static void main(String[] argv) { File xmlReport = new File(argv[0]); SAXReader saxReader = new SAXReader(); try { XMLTolerantErrorHandler.attach(saxReader, true); } catch (SAXException ex) { ex.printStackTrace(); } Document result; try { result = saxReader.read(xmlReport); } catch (DocumentException ex) { ex.printStackTrace(); return; } Element root = result.getRootElement(); System.out.println("ROOT: "+root); } }