improvements to XML handling