class FormElement extends Element {

    public List<Connection.KeyVal> formData() {
        ArrayList<Connection.KeyVal> data = new ArrayList<Connection.KeyVal>();

        // iterate the form control elements and accumulate their values
        for (Element el: elements) {
            if (!el.tag().isFormSubmittable()) continue; // contents are form listable, superset of submitable
            String name = el.attr("name");
            if (name.length() == 0) continue;

            if ("select".equals(el.tagName())) {
                Elements options = el.select("option[selected]");
                for (Element option: options) {
                    data.add(HttpConnection.KeyVal.create(name, option.val()));
                }
            } else {
                data.add(HttpConnection.KeyVal.create(name, el.val()));
            }
        }
        return data;
    }

    public  FormElement(Tag tag, String baseUri, Attributes attributes);

}