Defining subdomains of 3D mesh

I’m not sure how to do this with paraview, but it seems that most people (including myself) use gmsh in order to do this for more complicated meshes. This tutorial is a bit outdated, but it should get you started: http://mypages.iit.edu/~asriva13/?page_id=586

If you want to know further details (for example since the .xml format is deprecated) take a look here: Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio