backport xml fixes to 0.20