Generate xml for desired fields in the document

Hi:

i have document with some fields out of which one field is richtext, i have to generate xml for the richtext and some desired fields , i am new to xml could any one give some sample code to move forward, i know how to process entire document, but i want to generate for specific fields.