It seems that usinfg nested XMLFOREST with EVALNAME creates wrong xml TAG.
In the example below, the second query won't create the "test" TAG:
create table test_evalname(c1 number,c2 number);
SELECT
XMLElement(
"TABLE",
XMLForest(
e.TABLE_NAME AS "TABLE_NAME",
e.COLUMN_NAME AS "COLUMN_NAME",
XMLForest(
e.DATA_TYPE as "DATA_TYPE",
e.DATA_LENGTH as "DATA_LENGTH"
) as "test",
e.NULLABLE AS "NULLABLE"
)
) as xxml
from user_tab_columns e
where table_name='TEST_EVALNAME';
SELECT
XMLElement(
"TABLE",
XMLForest(
e.TABLE_NAME AS "TABLE_NAME",
e.COLUMN_NAME AS "COLUMN_NAME",
XMLForest(
e.DATA_TYPE as "DATA_TYPE",
e.DATA_LENGTH as "DATA_LENGTH"
) as "test",
e.NULLABLE AS evalname('NULLABLE')
)
) as xxml
from user_tab_columns e
where table_name='TEST_EVALNAME';