Fix minor memory leak in xmldoc