XmlToJson Read and parse the XML file using DocumentBuilder and DocumentBuilderFactory classes Then creates the JSON object from the parsed XML.