class GephiWriter {

    static final String VERSION = "0.9";

    public static void writeProject(XMLStreamWriter writer, Project project) throws Exception {<FILL_FUNCTION_BODY>}

    public static void writeWorkspace(XMLStreamWriter writer, Workspace workspace) throws Exception {
        writer.writeStartDocument("UTF-8", "1.0");
        writer.writeStartElement("workspace");

        WorkspaceInformation info = workspace.getLookup().lookup(WorkspaceInformation.class);

        writer.writeAttribute("name", info.getName());
        writer.writeAttribute("id", String.valueOf(workspace.getId()));
        if (info.isOpen()) {
            writer.writeAttribute("status", "open");
        } else if (info.isClosed()) {
            writer.writeAttribute("status", "closed");
        } else {
            writer.writeAttribute("status", "invalid");
        }

        //MetaData
        WorkspaceMetaData workspaceMetaData = workspace.getWorkspaceMetadata();
        writer.writeStartElement("metadata");

        writer.writeStartElement("title");
        writer.writeCharacters(workspaceMetaData.getTitle());
        writer.writeEndElement();

        writer.writeStartElement("description");
        writer.writeCharacters(workspaceMetaData.getDescription());
        writer.writeEndElement();
        //End MetaData

        writer.writeEndElement();
        writer.writeEndDocument();
    }

    public static void writeWorkspaceChildren(XMLStreamWriter writer, Workspace workspace,
                                              WorkspaceXMLPersistenceProvider persistenceProvider) throws Exception {
        String identifier = persistenceProvider.getIdentifier();
        writer.writeStartDocument("UTF-8", "1.0");
        writer.writeStartElement(identifier);
        writer.writeComment("Persistence from '" + identifier + "' (" + persistenceProvider.getClass().getName() + ")");
        try {
            persistenceProvider.writeXML(writer, workspace);
        } catch (Exception e) {
            Logger.getLogger("").log(
                Level.SEVERE,
                "Error while writing XML workspace persistence provider '" + identifier + "'",
                e);
        }
        writer.writeEndElement();
        writer.writeEndDocument();
    }

    private static String getVersion() {
        try {
            return MessageFormat.format(
                NbBundle.getBundle("org.netbeans.core.startup.Bundle").getString("currentVersion"), // NOI18N
                // NOI18N
                System.getProperty("netbeans.buildnumber"));
        } catch (Exception e) {
            return "?";
        }
    }
}

        writer.writeStartDocument("UTF-8", "1.0");
        writer.writeStartElement("projectFile");

        // Header
        writer.writeAttribute("version", VERSION);
        writer.writeStartElement("lastModifiedDate");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Calendar cal = Calendar.getInstance();
        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
        writer.writeCharacters(sdf.format(cal.getTime()));
        writer.writeComment("yyyy-MM-dd HH:mm:ss");
        writer.writeEndElement();
        writer.writeComment("File saved with " + getVersion());

        ProjectMetaData metaData = project.getLookup().lookup(ProjectMetaData.class);

        //Start Project
        writer.writeStartElement("project");
        writer.writeAttribute("id", project.getUniqueIdentifier());
        writer.writeAttribute("name", project.getName());
        writer.writeAttribute("ids", String.valueOf(((ProjectImpl) project).getWorkspaceIds()));

        //MetaData
        writer.writeStartElement("metadata");

        writer.writeStartElement("title");
        writer.writeCharacters(metaData.getTitle());
        writer.writeEndElement();

        writer.writeStartElement("keywords");
        writer.writeCharacters(metaData.getKeywords());
        writer.writeEndElement();

        writer.writeStartElement("description");
        writer.writeCharacters(metaData.getDescription());
        writer.writeEndElement();

        writer.writeStartElement("author");
        writer.writeCharacters(metaData.getAuthor());
        writer.writeEndElement();

        writer.writeEndElement();
        //End Metadata

        writer.writeEndElement();
        //End Project

        writer.writeEndElement();
        writer.writeEndDocument();
    
<no_super_class>