legacy: fix field xml output generation

* Addresses issue when unnecessary string conversion could cause
  problems with unicode data.  (closes #2233)

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>