public String createEnvironment() {

        // returns a string containing a fully written out environment for this
        // datasource
        StringBuilder sb = new StringBuilder();

        sb.append( TAB + TAB + "<environment id=\"" + this.environmentName
                + "\">\n" );
        sb.append( TAB + TAB + TAB + "<transactionManager type=\""
                + this.transactionManager + "\" />\n" );
        sb.append( TAB + TAB + TAB + "<dataSource type=\""
                + this.typeOfDataSource + "\">\n" );

        if ( this.dataSource.equals( "" ) == false ) {
            sb.append( TAB + TAB + TAB + TAB
                    + "<property name=\"data_source\" value=\""
                    + this.dataSource + "\" />\n" );
        }
        if ( this.driver.equals( "" ) == false ) {
            sb.append( TAB + TAB + TAB + TAB
                    + "<property name=\"driver\" value=\"" + this.driver
                    + "\" />\n" );
        }
        if ( this.url.equals( "" ) == false ) {
            sb.append( TAB + TAB + TAB + TAB
                    + "<property name=\"url\" value=\"" + this.url + "\" />\n" );
        }
        
        sb.append( createLoginInfo() );
        sb.append( TAB + TAB + TAB + "</dataSource>\n" );
        sb.append( TAB + TAB + "</environment>\n" );

        return sb.toString();
    }