public String getHeader()
    {
        StringBuffer buffer = new StringBuffer();

        String outputEncoding = this.outputEncoding;
        if ( outputEncoding == null )
        {
            outputEncoding = "UTF-8";
        }

        // header
        buffer
            .append(
                "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" )
            .append( "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"" ).append( locale )
            .append( "\" lang=\"" ).append( locale ).append( "\">\n" ).append( "<head>\n" )
            .append( "<meta http-equiv=\"content-type\" content=\"text/html; charset=" ).append( outputEncoding )
            .append( "\" />\n" );

        // title ("classname xref")
        buffer.append( "<title>" );
        try
        {
            JavaFile javaFile = fileManager.getFile( this.getCurrentFilename() );
            // Use the name of the file instead of the class to handle inner classes properly
            if ( javaFile.getClassType() != null && javaFile.getClassType().getFilename() != null )
            {
                buffer.append( javaFile.getClassType().getFilename() );
            }
            else
            {
                buffer.append( this.getCurrentFilename() );
            }
            buffer.append( " " );
        }
        catch ( IOException e )
        {
            e.printStackTrace();
        }
        finally
        {
            buffer.append( "xref</title>\n" );
        }

        // stylesheet link
        buffer.append( "<link type=\"text/css\" rel=\"stylesheet\" href=\"" ).append( this.getPackageRoot() )
            .append( STYLESHEET_FILENAME ).append( "\" />\n" );

        buffer.append( "</head>\n" ).append( "<body>\n" ).append( this.getFileOverview() );

        // start code section
        buffer.append( "<pre>" ); //Remove a new line to facilitate styling

        return buffer.toString();
    }