DOMElement->setAttribute Adds new attribute &reftitle.description; DOMElement bool setAttribute stringname stringvalue Sets an attribute with name name to the given value. If the attribute does not exist, it will be created. Throws DOMException if node cannot be modified. Setting an attribute createElement("para"); $newnode = $doc->appendChild($node); $newnode->setAttribute("align", "left"); ?> ]]> See also DOMElement->getAttribute()