Added full implementation of XML exporter.