flatten to xport