Fix NPE in XmlEntityService