Can now export successfully to an xml tree.