Export solution to XDMF (Nédélec elements)

I am trying to export the solution of an FEM problem computed using Nédélec elements to XDMF and I am not sure, if in Paraview the result is displayed correctly. I have also seen here that in Fenics one had to interpolate to a DG function. Is this still true for Fenicsx?

Yes, you should interpolate the function from the Nedelec function space to a suitable DG space (Which contains the nedelec space), and write that to file with the dolfinx.io.VTXWriter

Okay, if I am using Nédélec elements of the lowest order in two dimensions, which DG space would that be?

A k-th order Nedelec element is embedded in a DG-k space, Ref DefElement: Raviart–Thomas