Instead of making a HTTP request and parsing the XML response, it's possible for pages to invoke the search SOAP API. This allows interactions with the Appliance to appear as local function calls, automatically handling all the details of HTTP requests and XML parsing.
See the SOAP API (here) for details on setting up and using the SOAP API.