AJAX can be used for interactive communication with an XML file.
The Below example will demonstrate how a web page can fetch information from an XML file with AJAX:
When a user clicks on the "Get CD info" button above, the axqdocument() function is executed.
The axqdocument() function creates an XMLHttpRequest object, adds the function to be executed when the server response is ready, and sends the request off to the server.
When the server response is ready, an HTML table is built, nodes (elements) are extracted from the XML file, and it finally updates the txtCDInfo placeholder with the HTML table filled with XML data:
Your Query was successfully sent!