How do I form an XML data string from the APEX queries ?
Any particular class I should be using ?
Apex has a Class called XmlStreamWriter for constructing XML document. Refer the documentation at - XmlStreamWriter Class