public void saveSettings(String pFileName) {
        TableViewAdapter adapter = (TableViewAdapter) getModel();
        TableViewColumn[] columns = adapter.getModel().getColumns();
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        try {
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.newDocument();
            Element xroot = doc.createElement("xml");
            doc.appendChild(xroot);
            Element broot = doc.createElement("body");
            xroot.appendChild(broot);

            //resize
            Element er = doc.createElement("auto_resize_column");
            if (mRadioButtonMenuItemAutoResizeColumnAll.isSelected()) {
                er.setAttribute("selected", "All");
            }
            else if (mRadioButtonMenuItemAutoResizeColumnNext.isSelected()) {
                er.setAttribute("selected", "Next");
            }
            else if (mRadioButtonMenuItemAutoResizeColumnNone.isSelected()) {
                er.setAttribute("selected", "None");
            }
            broot.appendChild(er);

            //enabled/disabled columns
            for (int i = 0; i < columns.length; i++) {
                final TableViewColumn column = columns[i];
                Element e = doc.createElement("column");
                broot.appendChild(e);
                //column name
                e.setAttribute("id", column.getName());

                //visibility
                if (adapter.isVisible(column)) {
                    e.setAttribute("visible", "true");
                }
                else {
                    e.setAttribute("visible", "false");
                }

                //column width
                for (int j = 0; j < getColumnCount(); j++) {
                    TableColumn tableColumn = getColumnModel().getColumn(j);
                    if (tableColumn.getHeaderValue().toString().compareTo(column.getName()) == 0) {
                        e.setAttribute("width", new Integer(tableColumn.getWidth()).toString());
                        break;
                    }
                }
            }

            //save the document
            writeXmlToFile(pFileName, doc);
        }
        catch (ParserConfigurationException e) {
            e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
        }
    }