<?php

class Walker_Simple_Example extends Walker {
    var $db_fields = array('parent' => 'parent', 'id' => 'term_id');

    function start_lvl(&$output, $depth=0, $args=array()) {
        $output .= "\n<ul>\n";
    }

    function end_lvl(&$output, $depth=0, $args=array()) {
        $output .= "</ul>\n";
    }

    function start_el(&$output, $item, $depth=0, $args=array()) {
        $output .= "<li>".esc_attr($item->name);
    }

    function end_el(&$output, $item, $depth=0, $args=array()) {
        $output .= "</li>\n";
    }
}

$elements = get_categories();
$walker = new Walker_Simple_Example;
echo $walker->walk($elements, 0);
