Given this code fragment:
dcl buffer char(800);
dcl written fixed bin(31);
dcl next pointer;
dcl left fixed bin(31);
dcl
1 a,
2 a1,
3 b1 char(8),
3 b2 char(8),
2 a2,
3 c1 fixed bin,
3 c2 fixed dec(5,1);
b1 = ' t1';
b2 = 't2';
c1 = 17;
c2 = -29;
next = addr(buffer);
left = stg(buffer);
written = xmlchar( a, next, left );
next += written;
left -= written;
The following bytes would be written to the buffer, and written would be set equal to 72.
<A><A1><B1>t1</B1><B2>t2</B2></A1><A2><C1>17</C1><C2>-29.0</C2></A2></A>
Note that by default the names of the variables in the generated XML are all in upper case. The CASE(ASIS) suboption of the XML compiler option can be used to specify that the names appear in the case in which they were declared.