How to generate xml document with dynamic data

Hi,
I have a scenario to generate XML document with dynamic data .Need to take data through an action then automatically required XML document should be generated

Could you please help me on this

OriginalPostID-255853

  Discussion posts and replies are publicly visible