A method for automatically generating code for converting data from stored
procedures to an XML format is performed by a wizard with which a client
interfaces. The wizard receives a selection of a stored procedure,
determines an output data format for the selected stored procedure,
obtains a definition of an XML document which contains which portions of
the output data format to include in the XML document, and generates code
for a wrapper. The wrapper would call the stored procedure and generate
the defined XML document. The XML document is then returned by the
wrapper. In this manner, the code for converting data to the XML format
need not be manually generated. The data also need not be manually
converted to the XML format.