There are many post on this throughout the forum (simply search for Measure or XDMFFile) and you Get results such as:
and