fixed segfault on xml export. reinterpret_cast just does not work