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