FIXME: seems a code duplication of Xml::expandAttributes() follow up r81571 (skip attributes with null value)