When receiving post requests I set up 2 queries.
NEVERMIND, WAS TRYING TO PASTE CODE HERE BUT AM GETTING FRUSTRATED.
code snippet in tweet
For each query the results are assigned or concatenated into an action variable and the XML/JSON results are handled later in the module (usually by additional SQL queries).
The system seciton of these may be helpful for you: https://github.com/kevinmschreiner/OpenWebStudio/tree/master/Examples/Configurations