Reading file in Java is very easy because Java provides good support for xml file reading with lots of XML parsers including popular DOM parser and SAX Parser in Java. You can read xml file by using either SAX(Simple API for XML) parser or DOM (Document Object model) parser in Java.
SAX and DOM parsers are two very popular XML Parse used to read XML files in Java but there is difference how they parse xml file and without knowling there limitation if you parse large xml files you can get several errors.see Difference between SAX and DOM parsers and guides when to use DOM parser and when to use SAX parser in java.
Check out this article if you are looking to read xml file using DOM parser or check this article which contains step by step example with full java code for reading xml file in Java using SAX parser and advantage of SAX parser over DOM parser.
Even properties file can also be represented using xml format but Java has special API for reading XML properties file.