def add_class_to_node(node, classname):
    """ Adds the given classname to the given lxml node's class list. """
    if 'class' in node.attrib:
        node.attrib['class'] += ' ' + classname
    else:
        node.attrib['class'] = classname
