The attached COBOL program incorrectly generates XML for nested elements even when the "with attributes" phrase is specified. In the correct generation, every child should be treated as an attribute, not an element.
The attached example is copied from IBM's programmer guide, see here
$ cobc -x XGFX.cbl && ./XGFX
<G A="aaa" E="eee"><B><C>ccc</C><D>ddd</D></B></G>
<G A="aaa" E="eee"><B C="ccc" D="ddd"></B></G>
$ cobc --version
cobc (GnuCOBOL) 3.3-dev.0
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
Built Apr 04 2024 22:42:48
Packaged Apr 03 2024 20:03:09 UTC
C version "13.2.1 20230801"
This bug was first mentioned here by @sf-mensch