add back the missing fixes that was caused by a revert. Add functions to
support XBel exporter.