Code extracted from: git://xdmf.org/Xdmf.git at commit 6e4cb06a77563e86229f8ca202b943df6dd3fa3a (master).