public void setCommands(List<Command> commands) {
        rootElement.find("commands command").remove();
        Match container = rootElement.find("commands");
        container.text("");

        for (Command c : commands) {
            container.append( $("<command></command>") );
            Match element = container.find("command").last();

            element.attr("name", c.name);
            element.text(c.content);
        }
    }