XmlElement.setAttribute

void setAttribute(string qname, string value, XmlLocation location = XmlLocation.init) @safe

Sets an attribute value, adding the attribute if it does not exist.

Parameters

qnameAttribute QName.
valueAttribute value.
locationOptional location in the source XML.