backport xml fixes to 0.18