Reply to comment
One useful feature youll want to use in the API_DoQuery call is the <fmt>structured</fmt> parameter. By default the query returns are not structured. Basically, youll just get the table name, any DBVars, and the record data with the fields you specified, all with the field names, like this:
<business_phone_number>(123) 103-1234 x12345</business_phone_number>
<f id="6">(650) 123-1234</f>
<f id="22"> Model_T.jpg
Using structured format, youll also get some of the same information about the table as if you called API_GetSchema: table dbid, metadata information, a list of all saved queries you can use, the field properties (including field help, which could be used for tooltips) and the default values for all the fields you asked for in your query. Then, in the field returns themselves, the field data is presented in a more compact form so you can immediately spot the fid and the actual field value.