Minor refactor to XMLElement