Using vtk libraries for writing in xml/vtk fileformat

I am interested in writing files of finite element meshes and results in vtk format. I have found information about it in Text Book Manual of VTK. However, I would like to know if there are libraries that allows to write these type of files or it is necessary to implement oneself.

Thank you

A good place to start is with the vtk-examples e,g ReadUnknownTypeXMLFile this may also help: how to handle FEM data in VTK?

Thanks for your answer. When I try to build the project I have the following error/warning: " Could not find the VTK package with the following required components: RenderingContextOpenGL2."

Did you build VTK with OpenGL2 enabled?

I’m sorry but I am beginning to use VTK and I didn’t know anything about RenderingContextOpenGL2. Is it possible to activate this option after VTK package is installed?