Small XmlUtil simplifications and related cleanup

These are small simplifications and cleanup I've identified possible while looking at the code.