Use AJAX functions to get XML and XSL. Use the transform method to convert XML to HTML using XSL otherwise get the XML and retrieve data from the XML using DOM functions.
The following methods are self optimizing when used. Check each method by clicking one of the following method buttons before and after testing.
Click on each of the buttons to test different types of an AJAX call. Each button will make an AJAX call to retrieve data for Adam Aaron from his person document and display data from the internetaddress, officestreetaddress, officecountry and officezip fields.
If I need the result right away I use a synchronous call. An example might be in an onsubmit handler where you can't return control back to the user because the onsubmit handler has to return a true or false value. An asynchronous call will return control to the user while it waits for the result.