I'm not sure I understand the question.
The 'ML' in 'XML' stands for "Markup Language" (just as it does in HTML, which is more-or-less a subset of XML)
Your question is roughly like asking "Does anyone know how to convert the Gettysburg Address into HTML?" One is raw data, the other is formatting.
What I think you are asking is "How do I get PLC data out of the PLC and into a text file?". To do that, you need a driver that is capable of talking to the PLC (OPC is probably the way to go - check out KEPware which has OPC drivers for almost all PLCs) and then you need to write some software (VB, C++) that uses the driver to call the data, and then generate an XML file that packages that data into whatever XML tags you want.