upgraded xml export mechanism