Close bug # 19845 Record::toXML returns nothing

When the toXML() routine was refactored, a dangling reference to a
non-existent variable was left behind. In addition, we were able to
improve the toXML() routine such that it returns XML without
automatically printing it. Thanks to jfragoulis for reporting this
problem and offering a suggested fix.

Signed-off-by: Dan Scott <dan@coffeecode.net>