Export function now returns the XML string.