You can produce XML output from a COBOL program by using the XML GENERATE statement.
Optionally, you can generate an XML declaration for the document, and can cause eligible source data items to be expressed as attributes in the output rather than as elements.
You can use the XML-CODE special register to determine the status of XML generation.
After you transform COBOL data items to XML, you can use the resulting XML output in various ways, such as deploying it in a web service, writing it to a file, or passing it as a parameter to another program.
related tasks
Generating XML output
Controlling the encoding of generated XML output
Handling XML GENERATE exceptions
Enhancing XML output
related references
Extensible Markup Language (XML)
XML GENERATE statement (COBOL for AIX Language Reference)