Ahh, i think i understand. 
I need to use my module to format the PostgreSQL data in XML inside C and pass it to the
switch_xml_bind_search_function()
<snip>