I get the same problem using the xmlelement() function. i.e.
select xmlelement ("root", xmlattributes( person_id, last_name, first_name)) from person
The 7th row is a but when I open it up, it is empty. Other rows have a error. The empty value also appears on rows 37, 107, 137, 207, etc...