added check for empty field name when converting output to XML