public function appendAttr(DOMElement &$element, $name, $value)
    {
        // Create new attribute value
        $value = trim((string)$value);
        $old_value = $element->getAttribute($name);
        $value = trim(trim((string)$old_value) . ' ' . $value);

        // Set new attribute value
        return $this->attr($element, $name, $value);
    }