Code extracted from: git://xdmf.org/Xdmf.git at commit 86113671eaa9582f0e24d01bd4160a46d8e94c5b (master).