/*
 =================== DO NOT EDIT THIS FILE ====================
 Generated by Modello 1.5 on 2016-10-03 11:37:27,
 any modifications will be overwritten.
 ==============================================================
 */

package org.sonatype.maven.polyglot.xml.xpp3;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import java.io.OutputStream;
import java.io.Writer;
import java.util.Iterator;
import org.apache.maven.model.Activation;
import org.apache.maven.model.ActivationFile;
import org.apache.maven.model.ActivationOS;
import org.apache.maven.model.ActivationProperty;
import org.apache.maven.model.Build;
import org.apache.maven.model.BuildBase;
import org.apache.maven.model.CiManagement;
import org.apache.maven.model.ConfigurationContainer;
import org.apache.maven.model.Contributor;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.DeploymentRepository;
import org.apache.maven.model.Developer;
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.model.Exclusion;
import org.apache.maven.model.Extension;
import org.apache.maven.model.FileSet;
import org.apache.maven.model.IssueManagement;
import org.apache.maven.model.License;
import org.apache.maven.model.MailingList;
import org.apache.maven.model.Model;
import org.apache.maven.model.ModelBase;
import org.apache.maven.model.Notifier;
import org.apache.maven.model.Organization;
import org.apache.maven.model.Parent;
import org.apache.maven.model.PatternSet;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginConfiguration;
import org.apache.maven.model.PluginContainer;
import org.apache.maven.model.PluginExecution;
import org.apache.maven.model.PluginManagement;
import org.apache.maven.model.Prerequisites;
import org.apache.maven.model.Profile;
import org.apache.maven.model.Relocation;
import org.apache.maven.model.ReportPlugin;
import org.apache.maven.model.ReportSet;
import org.apache.maven.model.Reporting;
import org.apache.maven.model.Repository;
import org.apache.maven.model.RepositoryBase;
import org.apache.maven.model.RepositoryPolicy;
import org.apache.maven.model.Resource;
import org.apache.maven.model.Scm;
import org.apache.maven.model.Site;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.pull.MXSerializer;
import org.codehaus.plexus.util.xml.pull.XmlSerializer;

/**
 * Class MavenXpp3Writer.
 * 
 * @version $Revision$ $Date$
 */
public class PolyglotMavenXpp3Writer
{

      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field NAMESPACE.
     */
    private static final String NAMESPACE = null;


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method write.
     * 
     * @param writer
     * @param model
     * @throws java.io.IOException
     */
    public void write( Writer writer, Model model )
        throws java.io.IOException
    {
        XmlSerializer serializer = new MXSerializer();
        serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-indentation", "  " );
        serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", "\n" );
        serializer.setOutput( writer );
        serializer.startDocument( model.getModelEncoding(), null );
        writeModel( model, "project", serializer );
        serializer.endDocument();
    } //-- void write( Writer, Model )

    /**
     * Method write.
     * 
     * @param stream
     * @param model
     * @throws java.io.IOException
     */
    public void write( OutputStream stream, Model model )
        throws java.io.IOException
    {
        XmlSerializer serializer = new MXSerializer();
        serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-indentation", "  " );
        serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", "\n" );
        serializer.setOutput( stream, model.getModelEncoding() );
        serializer.startDocument( model.getModelEncoding(), null );
        writeModel( model, "project", serializer );
        serializer.endDocument();
    } //-- void write( OutputStream, Model )

    /**
     * Method writeActivation.
     * 
     * @param activation
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeActivation( Activation activation, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( activation.isActiveByDefault() != false )
        {
            serializer.attribute( NAMESPACE, "activeByDefault", String.valueOf( activation.isActiveByDefault() ) );
        }
        if ( activation.getJdk() != null )
        {
            serializer.attribute( NAMESPACE, "jdk", activation.getJdk() );
        }
        if ( activation.getOs() != null )
        {
            writeActivationOS( (ActivationOS) activation.getOs(), "os", serializer );
        }
        if ( activation.getProperty() != null )
        {
            writeActivationProperty( (ActivationProperty) activation.getProperty(), "property", serializer );
        }
        if ( activation.getFile() != null )
        {
            writeActivationFile( (ActivationFile) activation.getFile(), "file", serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeActivation( Activation, String, XmlSerializer )

    /**
     * Method writeActivationFile.
     * 
     * @param activationFile
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeActivationFile( ActivationFile activationFile, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( activationFile.getMissing() != null )
        {
            serializer.attribute( NAMESPACE, "missing", activationFile.getMissing() );
        }
        if ( activationFile.getExists() != null )
        {
            serializer.attribute( NAMESPACE, "exists", activationFile.getExists() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeActivationFile( ActivationFile, String, XmlSerializer )

    /**
     * Method writeActivationOS.
     * 
     * @param activationOS
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeActivationOS( ActivationOS activationOS, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( activationOS.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", activationOS.getName() );
        }
        if ( activationOS.getFamily() != null )
        {
            serializer.attribute( NAMESPACE, "family", activationOS.getFamily() );
        }
        if ( activationOS.getArch() != null )
        {
            serializer.attribute( NAMESPACE, "arch", activationOS.getArch() );
        }
        if ( activationOS.getVersion() != null )
        {
            serializer.attribute( NAMESPACE, "version", activationOS.getVersion() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeActivationOS( ActivationOS, String, XmlSerializer )

    /**
     * Method writeActivationProperty.
     * 
     * @param activationProperty
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeActivationProperty( ActivationProperty activationProperty, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( activationProperty.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", activationProperty.getName() );
        }
        if ( activationProperty.getValue() != null )
        {
            serializer.attribute( NAMESPACE, "value", activationProperty.getValue() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeActivationProperty( ActivationProperty, String, XmlSerializer )

    /**
     * Method writeBuild.
     * 
     * @param build
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeBuild( Build build, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( build.getSourceDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "sourceDirectory", build.getSourceDirectory() );
        }
        if ( build.getScriptSourceDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "scriptSourceDirectory", build.getScriptSourceDirectory() );
        }
        if ( build.getTestSourceDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "testSourceDirectory", build.getTestSourceDirectory() );
        }
        if ( build.getOutputDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "outputDirectory", build.getOutputDirectory() );
        }
        if ( build.getTestOutputDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "testOutputDirectory", build.getTestOutputDirectory() );
        }
        if ( build.getDefaultGoal() != null )
        {
            serializer.attribute( NAMESPACE, "defaultGoal", build.getDefaultGoal() );
        }
        if ( build.getDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "directory", build.getDirectory() );
        }
        if ( build.getFinalName() != null )
        {
            serializer.attribute( NAMESPACE, "finalName", build.getFinalName() );
        }
        if ( ( build.getExtensions() != null ) && ( build.getExtensions().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "extensions" );
            for ( Iterator iter = build.getExtensions().iterator(); iter.hasNext(); )
            {
                Extension o = (Extension) iter.next();
                writeExtension( o, "extension", serializer );
            }
            serializer.endTag( NAMESPACE, "extensions" );
        }
        if ( ( build.getResources() != null ) && ( build.getResources().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "resources" );
            for ( Iterator iter = build.getResources().iterator(); iter.hasNext(); )
            {
                Resource o = (Resource) iter.next();
                writeResource( o, "resource", serializer );
            }
            serializer.endTag( NAMESPACE, "resources" );
        }
        if ( ( build.getTestResources() != null ) && ( build.getTestResources().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "testResources" );
            for ( Iterator iter = build.getTestResources().iterator(); iter.hasNext(); )
            {
                Resource o = (Resource) iter.next();
                writeResource( o, "testResource", serializer );
            }
            serializer.endTag( NAMESPACE, "testResources" );
        }
        if ( ( build.getFilters() != null ) && ( build.getFilters().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "filters" );
            for ( Iterator iter = build.getFilters().iterator(); iter.hasNext(); )
            {
                String filter = (String) iter.next();
                serializer.startTag( NAMESPACE, "filter" ).text( filter ).endTag( NAMESPACE, "filter" );
            }
            serializer.endTag( NAMESPACE, "filters" );
        }
        if ( build.getPluginManagement() != null )
        {
            writePluginManagement( (PluginManagement) build.getPluginManagement(), "pluginManagement", serializer );
        }
        if ( ( build.getPlugins() != null ) && ( build.getPlugins().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "plugins" );
            for ( Iterator iter = build.getPlugins().iterator(); iter.hasNext(); )
            {
                Plugin o = (Plugin) iter.next();
                writePlugin( o, "plugin", serializer );
            }
            serializer.endTag( NAMESPACE, "plugins" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeBuild( Build, String, XmlSerializer )

    /**
     * Method writeBuildBase.
     * 
     * @param buildBase
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeBuildBase( BuildBase buildBase, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( buildBase.getDefaultGoal() != null )
        {
            serializer.attribute( NAMESPACE, "defaultGoal", buildBase.getDefaultGoal() );
        }
        if ( buildBase.getDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "directory", buildBase.getDirectory() );
        }
        if ( buildBase.getFinalName() != null )
        {
            serializer.attribute( NAMESPACE, "finalName", buildBase.getFinalName() );
        }
        if ( ( buildBase.getResources() != null ) && ( buildBase.getResources().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "resources" );
            for ( Iterator iter = buildBase.getResources().iterator(); iter.hasNext(); )
            {
                Resource o = (Resource) iter.next();
                writeResource( o, "resource", serializer );
            }
            serializer.endTag( NAMESPACE, "resources" );
        }
        if ( ( buildBase.getTestResources() != null ) && ( buildBase.getTestResources().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "testResources" );
            for ( Iterator iter = buildBase.getTestResources().iterator(); iter.hasNext(); )
            {
                Resource o = (Resource) iter.next();
                writeResource( o, "testResource", serializer );
            }
            serializer.endTag( NAMESPACE, "testResources" );
        }
        if ( ( buildBase.getFilters() != null ) && ( buildBase.getFilters().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "filters" );
            for ( Iterator iter = buildBase.getFilters().iterator(); iter.hasNext(); )
            {
                String filter = (String) iter.next();
                serializer.startTag( NAMESPACE, "filter" ).text( filter ).endTag( NAMESPACE, "filter" );
            }
            serializer.endTag( NAMESPACE, "filters" );
        }
        if ( buildBase.getPluginManagement() != null )
        {
            writePluginManagement( (PluginManagement) buildBase.getPluginManagement(), "pluginManagement", serializer );
        }
        if ( ( buildBase.getPlugins() != null ) && ( buildBase.getPlugins().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "plugins" );
            for ( Iterator iter = buildBase.getPlugins().iterator(); iter.hasNext(); )
            {
                Plugin o = (Plugin) iter.next();
                writePlugin( o, "plugin", serializer );
            }
            serializer.endTag( NAMESPACE, "plugins" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeBuildBase( BuildBase, String, XmlSerializer )

    /**
     * Method writeCiManagement.
     * 
     * @param ciManagement
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeCiManagement( CiManagement ciManagement, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ciManagement.getSystem() != null )
        {
            serializer.attribute( NAMESPACE, "system", ciManagement.getSystem() );
        }
        if ( ciManagement.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", ciManagement.getUrl() );
        }
        if ( ( ciManagement.getNotifiers() != null ) && ( ciManagement.getNotifiers().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "notifiers" );
            for ( Iterator iter = ciManagement.getNotifiers().iterator(); iter.hasNext(); )
            {
                Notifier o = (Notifier) iter.next();
                writeNotifier( o, "notifier", serializer );
            }
            serializer.endTag( NAMESPACE, "notifiers" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeCiManagement( CiManagement, String, XmlSerializer )

    /**
     * Method writeConfigurationContainer.
     * 
     * @param configurationContainer
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeConfigurationContainer( ConfigurationContainer configurationContainer, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( configurationContainer.getInherited() != null )
        {
            serializer.attribute( NAMESPACE, "inherited", configurationContainer.getInherited() );
        }
        if ( configurationContainer.getConfiguration() != null )
        {
            ((Xpp3Dom) configurationContainer.getConfiguration()).writeToSerializer( NAMESPACE, serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeConfigurationContainer( ConfigurationContainer, String, XmlSerializer )

    /**
     * Method writeContributor.
     * 
     * @param contributor
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeContributor( Contributor contributor, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( contributor.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", contributor.getName() );
        }
        if ( contributor.getEmail() != null )
        {
            serializer.attribute( NAMESPACE, "email", contributor.getEmail() );
        }
        if ( contributor.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", contributor.getUrl() );
        }
        if ( contributor.getOrganization() != null )
        {
            serializer.attribute( NAMESPACE, "organization", contributor.getOrganization() );
        }
        if ( contributor.getOrganizationUrl() != null )
        {
            serializer.attribute( NAMESPACE, "organizationUrl", contributor.getOrganizationUrl() );
        }
        if ( contributor.getTimezone() != null )
        {
            serializer.attribute( NAMESPACE, "timezone", contributor.getTimezone() );
        }
        if ( ( contributor.getRoles() != null ) && ( contributor.getRoles().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "roles" );
            for ( Iterator iter = contributor.getRoles().iterator(); iter.hasNext(); )
            {
                String role = (String) iter.next();
                serializer.startTag( NAMESPACE, "role" ).text( role ).endTag( NAMESPACE, "role" );
            }
            serializer.endTag( NAMESPACE, "roles" );
        }
        if ( ( contributor.getProperties() != null ) && ( contributor.getProperties().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "properties" );
            for ( Iterator iter = contributor.getProperties().keySet().iterator(); iter.hasNext(); )
            {
                String key = (String) iter.next();
                String value = (String) contributor.getProperties().get( key );
                serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
            }
            serializer.endTag( NAMESPACE, "properties" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeContributor( Contributor, String, XmlSerializer )

    /**
     * Method writeDependency.
     * 
     * @param dependency
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeDependency( Dependency dependency, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( dependency.getGroupId() != null )
        {
            serializer.attribute( NAMESPACE, "groupId", dependency.getGroupId() );
        }
        if ( dependency.getArtifactId() != null )
        {
            serializer.attribute( NAMESPACE, "artifactId", dependency.getArtifactId() );
        }
        if ( dependency.getVersion() != null )
        {
            serializer.attribute( NAMESPACE, "version", dependency.getVersion() );
        }
        if ( ( dependency.getType() != null ) && !dependency.getType().equals( "jar" ) )
        {
            serializer.attribute( NAMESPACE, "type", dependency.getType() );
        }
        if ( dependency.getClassifier() != null )
        {
            serializer.attribute( NAMESPACE, "classifier", dependency.getClassifier() );
        }
        if ( dependency.getScope() != null )
        {
            serializer.attribute( NAMESPACE, "scope", dependency.getScope() );
        }
        if ( dependency.getSystemPath() != null )
        {
            serializer.attribute( NAMESPACE, "systemPath", dependency.getSystemPath() );
        }
        if ( ( dependency.getOptional() != null ) && !dependency.getOptional().equals( "false" ) )
        {
            serializer.attribute( NAMESPACE, "optional", dependency.getOptional() );
        }
        if ( ( dependency.getExclusions() != null ) && ( dependency.getExclusions().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "exclusions" );
            for ( Iterator iter = dependency.getExclusions().iterator(); iter.hasNext(); )
            {
                Exclusion o = (Exclusion) iter.next();
                writeExclusion( o, "exclusion", serializer );
            }
            serializer.endTag( NAMESPACE, "exclusions" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeDependency( Dependency, String, XmlSerializer )

    /**
     * Method writeDependencyManagement.
     * 
     * @param dependencyManagement
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeDependencyManagement( DependencyManagement dependencyManagement, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( dependencyManagement.getDependencies() != null ) && ( dependencyManagement.getDependencies().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "dependencies" );
            for ( Iterator iter = dependencyManagement.getDependencies().iterator(); iter.hasNext(); )
            {
                Dependency o = (Dependency) iter.next();
                writeDependency( o, "dependency", serializer );
            }
            serializer.endTag( NAMESPACE, "dependencies" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeDependencyManagement( DependencyManagement, String, XmlSerializer )

    /**
     * Method writeDeploymentRepository.
     * 
     * @param deploymentRepository
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeDeploymentRepository( DeploymentRepository deploymentRepository, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( deploymentRepository.isUniqueVersion() != true )
        {
            serializer.attribute( NAMESPACE, "uniqueVersion", String.valueOf( deploymentRepository.isUniqueVersion() ) );
        }
        if ( deploymentRepository.getId() != null )
        {
            serializer.attribute( NAMESPACE, "id", deploymentRepository.getId() );
        }
        if ( deploymentRepository.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", deploymentRepository.getName() );
        }
        if ( deploymentRepository.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", deploymentRepository.getUrl() );
        }
        if ( ( deploymentRepository.getLayout() != null ) && !deploymentRepository.getLayout().equals( "default" ) )
        {
            serializer.attribute( NAMESPACE, "layout", deploymentRepository.getLayout() );
        }
        if ( deploymentRepository.getReleases() != null )
        {
            writeRepositoryPolicy( (RepositoryPolicy) deploymentRepository.getReleases(), "releases", serializer );
        }
        if ( deploymentRepository.getSnapshots() != null )
        {
            writeRepositoryPolicy( (RepositoryPolicy) deploymentRepository.getSnapshots(), "snapshots", serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeDeploymentRepository( DeploymentRepository, String, XmlSerializer )

    /**
     * Method writeDeveloper.
     * 
     * @param developer
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeDeveloper( Developer developer, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( developer.getId() != null )
        {
            serializer.attribute( NAMESPACE, "id", developer.getId() );
        }
        if ( developer.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", developer.getName() );
        }
        if ( developer.getEmail() != null )
        {
            serializer.attribute( NAMESPACE, "email", developer.getEmail() );
        }
        if ( developer.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", developer.getUrl() );
        }
        if ( developer.getOrganization() != null )
        {
            serializer.attribute( NAMESPACE, "organization", developer.getOrganization() );
        }
        if ( developer.getOrganizationUrl() != null )
        {
            serializer.attribute( NAMESPACE, "organizationUrl", developer.getOrganizationUrl() );
        }
        if ( developer.getTimezone() != null )
        {
            serializer.attribute( NAMESPACE, "timezone", developer.getTimezone() );
        }
        if ( ( developer.getRoles() != null ) && ( developer.getRoles().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "roles" );
            for ( Iterator iter = developer.getRoles().iterator(); iter.hasNext(); )
            {
                String role = (String) iter.next();
                serializer.startTag( NAMESPACE, "role" ).text( role ).endTag( NAMESPACE, "role" );
            }
            serializer.endTag( NAMESPACE, "roles" );
        }
        if ( ( developer.getProperties() != null ) && ( developer.getProperties().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "properties" );
            for ( Iterator iter = developer.getProperties().keySet().iterator(); iter.hasNext(); )
            {
                String key = (String) iter.next();
                String value = (String) developer.getProperties().get( key );
                serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
            }
            serializer.endTag( NAMESPACE, "properties" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeDeveloper( Developer, String, XmlSerializer )

    /**
     * Method writeDistributionManagement.
     * 
     * @param distributionManagement
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeDistributionManagement( DistributionManagement distributionManagement, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( distributionManagement.getDownloadUrl() != null )
        {
            serializer.attribute( NAMESPACE, "downloadUrl", distributionManagement.getDownloadUrl() );
        }
        if ( distributionManagement.getStatus() != null )
        {
            serializer.attribute( NAMESPACE, "status", distributionManagement.getStatus() );
        }
        if ( distributionManagement.getRepository() != null )
        {
            writeDeploymentRepository( (DeploymentRepository) distributionManagement.getRepository(), "repository", serializer );
        }
        if ( distributionManagement.getSnapshotRepository() != null )
        {
            writeDeploymentRepository( (DeploymentRepository) distributionManagement.getSnapshotRepository(), "snapshotRepository", serializer );
        }
        if ( distributionManagement.getSite() != null )
        {
            writeSite( (Site) distributionManagement.getSite(), "site", serializer );
        }
        if ( distributionManagement.getRelocation() != null )
        {
            writeRelocation( (Relocation) distributionManagement.getRelocation(), "relocation", serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeDistributionManagement( DistributionManagement, String, XmlSerializer )

    /**
     * Method writeExclusion.
     * 
     * @param exclusion
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeExclusion( Exclusion exclusion, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( exclusion.getArtifactId() != null )
        {
            serializer.attribute( NAMESPACE, "artifactId", exclusion.getArtifactId() );
        }
        if ( exclusion.getGroupId() != null )
        {
            serializer.attribute( NAMESPACE, "groupId", exclusion.getGroupId() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeExclusion( Exclusion, String, XmlSerializer )

    /**
     * Method writeExtension.
     * 
     * @param extension
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeExtension( Extension extension, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( extension.getGroupId() != null )
        {
            serializer.attribute( NAMESPACE, "groupId", extension.getGroupId() );
        }
        if ( extension.getArtifactId() != null )
        {
            serializer.attribute( NAMESPACE, "artifactId", extension.getArtifactId() );
        }
        if ( extension.getVersion() != null )
        {
            serializer.attribute( NAMESPACE, "version", extension.getVersion() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeExtension( Extension, String, XmlSerializer )

    /**
     * Method writeFileSet.
     * 
     * @param fileSet
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeFileSet( FileSet fileSet, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( fileSet.getDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "directory", fileSet.getDirectory() );
        }
        if ( ( fileSet.getIncludes() != null ) && ( fileSet.getIncludes().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "includes" );
            for ( Iterator iter = fileSet.getIncludes().iterator(); iter.hasNext(); )
            {
                String include = (String) iter.next();
                serializer.startTag( NAMESPACE, "include" ).text( include ).endTag( NAMESPACE, "include" );
            }
            serializer.endTag( NAMESPACE, "includes" );
        }
        if ( ( fileSet.getExcludes() != null ) && ( fileSet.getExcludes().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "excludes" );
            for ( Iterator iter = fileSet.getExcludes().iterator(); iter.hasNext(); )
            {
                String exclude = (String) iter.next();
                serializer.startTag( NAMESPACE, "exclude" ).text( exclude ).endTag( NAMESPACE, "exclude" );
            }
            serializer.endTag( NAMESPACE, "excludes" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeFileSet( FileSet, String, XmlSerializer )

    /**
     * Method writeIssueManagement.
     * 
     * @param issueManagement
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeIssueManagement( IssueManagement issueManagement, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( issueManagement.getSystem() != null )
        {
            serializer.attribute( NAMESPACE, "system", issueManagement.getSystem() );
        }
        if ( issueManagement.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", issueManagement.getUrl() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeIssueManagement( IssueManagement, String, XmlSerializer )

    /**
     * Method writeLicense.
     * 
     * @param license
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeLicense( License license, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( license.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", license.getName() );
        }
        if ( license.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", license.getUrl() );
        }
        if ( license.getDistribution() != null )
        {
            serializer.attribute( NAMESPACE, "distribution", license.getDistribution() );
        }
        if ( license.getComments() != null )
        {
            serializer.attribute( NAMESPACE, "comments", license.getComments() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeLicense( License, String, XmlSerializer )

    /**
     * Method writeMailingList.
     * 
     * @param mailingList
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeMailingList( MailingList mailingList, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( mailingList.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", mailingList.getName() );
        }
        if ( mailingList.getSubscribe() != null )
        {
            serializer.attribute( NAMESPACE, "subscribe", mailingList.getSubscribe() );
        }
        if ( mailingList.getUnsubscribe() != null )
        {
            serializer.attribute( NAMESPACE, "unsubscribe", mailingList.getUnsubscribe() );
        }
        if ( mailingList.getPost() != null )
        {
            serializer.attribute( NAMESPACE, "post", mailingList.getPost() );
        }
        if ( mailingList.getArchive() != null )
        {
            serializer.attribute( NAMESPACE, "archive", mailingList.getArchive() );
        }
        if ( ( mailingList.getOtherArchives() != null ) && ( mailingList.getOtherArchives().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "otherArchives" );
            for ( Iterator iter = mailingList.getOtherArchives().iterator(); iter.hasNext(); )
            {
                String otherArchive = (String) iter.next();
                serializer.startTag( NAMESPACE, "otherArchive" ).text( otherArchive ).endTag( NAMESPACE, "otherArchive" );
            }
            serializer.endTag( NAMESPACE, "otherArchives" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeMailingList( MailingList, String, XmlSerializer )

    /**
     * Method writeModel.
     * 
     * @param model
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeModel( Model model, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.setPrefix( "", "http://maven.apache.org/POM/4.1.0" );
        serializer.setPrefix( "xsi", "http://www.w3.org/2001/XMLSchema-instance" );
        serializer.startTag( NAMESPACE, tagName );
        serializer.attribute( "", "xsi:schemaLocation", "http://maven.apache.org/POM/4.1.0 http://maven.apache.org/xsd/maven-4.1.0.xsd" );
        if ( model.getModelVersion() != null )
        {
            serializer.startTag( NAMESPACE, "modelVersion" ).text( model.getModelVersion() ).endTag( NAMESPACE, "modelVersion" );
        }
        if ( model.getParent() != null )
        {
            writeParent( (Parent) model.getParent(), "parent", serializer );
        }
        if ( model.getGroupId() != null )
        {
            serializer.startTag( NAMESPACE, "groupId" ).text( model.getGroupId() ).endTag( NAMESPACE, "groupId" );
        }
        if ( model.getArtifactId() != null )
        {
            serializer.startTag( NAMESPACE, "artifactId" ).text( model.getArtifactId() ).endTag( NAMESPACE, "artifactId" );
        }
        if ( model.getVersion() != null )
        {
            serializer.startTag( NAMESPACE, "version" ).text( model.getVersion() ).endTag( NAMESPACE, "version" );
        }
        if ( ( model.getPackaging() != null ) && !model.getPackaging().equals( "jar" ) )
        {
            serializer.startTag( NAMESPACE, "packaging" ).text( model.getPackaging() ).endTag( NAMESPACE, "packaging" );
        }
        if ( model.getName() != null )
        {
            serializer.startTag( NAMESPACE, "name" ).text( model.getName() ).endTag( NAMESPACE, "name" );
        }
        if ( model.getDescription() != null )
        {
            serializer.startTag( NAMESPACE, "description" ).text( model.getDescription() ).endTag( NAMESPACE, "description" );
        }
        if ( model.getUrl() != null )
        {
            serializer.startTag( NAMESPACE, "url" ).text( model.getUrl() ).endTag( NAMESPACE, "url" );
        }
        if ( model.getInceptionYear() != null )
        {
            serializer.startTag( NAMESPACE, "inceptionYear" ).text( model.getInceptionYear() ).endTag( NAMESPACE, "inceptionYear" );
        }
        if ( model.getOrganization() != null )
        {
            writeOrganization( (Organization) model.getOrganization(), "organization", serializer );
        }
        if ( ( model.getLicenses() != null ) && ( model.getLicenses().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "licenses" );
            for ( Iterator iter = model.getLicenses().iterator(); iter.hasNext(); )
            {
                License o = (License) iter.next();
                writeLicense( o, "license", serializer );
            }
            serializer.endTag( NAMESPACE, "licenses" );
        }
        if ( ( model.getDevelopers() != null ) && ( model.getDevelopers().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "developers" );
            for ( Iterator iter = model.getDevelopers().iterator(); iter.hasNext(); )
            {
                Developer o = (Developer) iter.next();
                writeDeveloper( o, "developer", serializer );
            }
            serializer.endTag( NAMESPACE, "developers" );
        }
        if ( ( model.getContributors() != null ) && ( model.getContributors().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "contributors" );
            for ( Iterator iter = model.getContributors().iterator(); iter.hasNext(); )
            {
                Contributor o = (Contributor) iter.next();
                writeContributor( o, "contributor", serializer );
            }
            serializer.endTag( NAMESPACE, "contributors" );
        }
        if ( ( model.getMailingLists() != null ) && ( model.getMailingLists().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "mailingLists" );
            for ( Iterator iter = model.getMailingLists().iterator(); iter.hasNext(); )
            {
                MailingList o = (MailingList) iter.next();
                writeMailingList( o, "mailingList", serializer );
            }
            serializer.endTag( NAMESPACE, "mailingLists" );
        }
        if ( model.getPrerequisites() != null )
        {
            writePrerequisites( (Prerequisites) model.getPrerequisites(), "prerequisites", serializer );
        }
        if ( ( model.getModules() != null ) && ( model.getModules().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "modules" );
            for ( Iterator iter = model.getModules().iterator(); iter.hasNext(); )
            {
                String module = (String) iter.next();
                serializer.startTag( NAMESPACE, "module" ).text( module ).endTag( NAMESPACE, "module" );
            }
            serializer.endTag( NAMESPACE, "modules" );
        }
        if ( model.getScm() != null )
        {
            writeScm( (Scm) model.getScm(), "scm", serializer );
        }
        if ( model.getIssueManagement() != null )
        {
            writeIssueManagement( (IssueManagement) model.getIssueManagement(), "issueManagement", serializer );
        }
        if ( model.getCiManagement() != null )
        {
            writeCiManagement( (CiManagement) model.getCiManagement(), "ciManagement", serializer );
        }
        if ( model.getDistributionManagement() != null )
        {
            writeDistributionManagement( (DistributionManagement) model.getDistributionManagement(), "distributionManagement", serializer );
        }
        if ( ( model.getProperties() != null ) && ( model.getProperties().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "properties" );
            for ( Iterator iter = model.getProperties().keySet().iterator(); iter.hasNext(); )
            {
                String key = (String) iter.next();
                String value = (String) model.getProperties().get( key );
                serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
            }
            serializer.endTag( NAMESPACE, "properties" );
        }
        if ( model.getDependencyManagement() != null )
        {
            writeDependencyManagement( (DependencyManagement) model.getDependencyManagement(), "dependencyManagement", serializer );
        }
        if ( ( model.getDependencies() != null ) && ( model.getDependencies().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "dependencies" );
            for ( Iterator iter = model.getDependencies().iterator(); iter.hasNext(); )
            {
                Dependency o = (Dependency) iter.next();
                writeDependency( o, "dependency", serializer );
            }
            serializer.endTag( NAMESPACE, "dependencies" );
        }
        if ( ( model.getRepositories() != null ) && ( model.getRepositories().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "repositories" );
            for ( Iterator iter = model.getRepositories().iterator(); iter.hasNext(); )
            {
                Repository o = (Repository) iter.next();
                writeRepository( o, "repository", serializer );
            }
            serializer.endTag( NAMESPACE, "repositories" );
        }
        if ( ( model.getPluginRepositories() != null ) && ( model.getPluginRepositories().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "pluginRepositories" );
            for ( Iterator iter = model.getPluginRepositories().iterator(); iter.hasNext(); )
            {
                Repository o = (Repository) iter.next();
                writeRepository( o, "pluginRepository", serializer );
            }
            serializer.endTag( NAMESPACE, "pluginRepositories" );
        }
        if ( model.getBuild() != null )
        {
            writeBuild( (Build) model.getBuild(), "build", serializer );
        }
        if ( model.getReports() != null )
        {
            ((Xpp3Dom) model.getReports()).writeToSerializer( NAMESPACE, serializer );
        }
        if ( model.getReporting() != null )
        {
            writeReporting( (Reporting) model.getReporting(), "reporting", serializer );
        }
        if ( ( model.getProfiles() != null ) && ( model.getProfiles().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "profiles" );
            for ( Iterator iter = model.getProfiles().iterator(); iter.hasNext(); )
            {
                Profile o = (Profile) iter.next();
                writeProfile( o, "profile", serializer );
            }
            serializer.endTag( NAMESPACE, "profiles" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeModel( Model, String, XmlSerializer )

    /**
     * Method writeModelBase.
     * 
     * @param modelBase
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeModelBase( ModelBase modelBase, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( modelBase.getModules() != null ) && ( modelBase.getModules().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "modules" );
            for ( Iterator iter = modelBase.getModules().iterator(); iter.hasNext(); )
            {
                String module = (String) iter.next();
                serializer.startTag( NAMESPACE, "module" ).text( module ).endTag( NAMESPACE, "module" );
            }
            serializer.endTag( NAMESPACE, "modules" );
        }
        if ( modelBase.getDistributionManagement() != null )
        {
            writeDistributionManagement( (DistributionManagement) modelBase.getDistributionManagement(), "distributionManagement", serializer );
        }
        if ( ( modelBase.getProperties() != null ) && ( modelBase.getProperties().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "properties" );
            for ( Iterator iter = modelBase.getProperties().keySet().iterator(); iter.hasNext(); )
            {
                String key = (String) iter.next();
                String value = (String) modelBase.getProperties().get( key );
                serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
            }
            serializer.endTag( NAMESPACE, "properties" );
        }
        if ( modelBase.getDependencyManagement() != null )
        {
            writeDependencyManagement( (DependencyManagement) modelBase.getDependencyManagement(), "dependencyManagement", serializer );
        }
        if ( ( modelBase.getDependencies() != null ) && ( modelBase.getDependencies().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "dependencies" );
            for ( Iterator iter = modelBase.getDependencies().iterator(); iter.hasNext(); )
            {
                Dependency o = (Dependency) iter.next();
                writeDependency( o, "dependency", serializer );
            }
            serializer.endTag( NAMESPACE, "dependencies" );
        }
        if ( ( modelBase.getRepositories() != null ) && ( modelBase.getRepositories().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "repositories" );
            for ( Iterator iter = modelBase.getRepositories().iterator(); iter.hasNext(); )
            {
                Repository o = (Repository) iter.next();
                writeRepository( o, "repository", serializer );
            }
            serializer.endTag( NAMESPACE, "repositories" );
        }
        if ( ( modelBase.getPluginRepositories() != null ) && ( modelBase.getPluginRepositories().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "pluginRepositories" );
            for ( Iterator iter = modelBase.getPluginRepositories().iterator(); iter.hasNext(); )
            {
                Repository o = (Repository) iter.next();
                writeRepository( o, "pluginRepository", serializer );
            }
            serializer.endTag( NAMESPACE, "pluginRepositories" );
        }
        if ( modelBase.getReports() != null )
        {
            ((Xpp3Dom) modelBase.getReports()).writeToSerializer( NAMESPACE, serializer );
        }
        if ( modelBase.getReporting() != null )
        {
            writeReporting( (Reporting) modelBase.getReporting(), "reporting", serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeModelBase( ModelBase, String, XmlSerializer )

    /**
     * Method writeNotifier.
     * 
     * @param notifier
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeNotifier( Notifier notifier, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( notifier.getType() != null ) && !notifier.getType().equals( "mail" ) )
        {
            serializer.attribute( NAMESPACE, "type", notifier.getType() );
        }
        if ( notifier.isSendOnError() != true )
        {
            serializer.attribute( NAMESPACE, "sendOnError", String.valueOf( notifier.isSendOnError() ) );
        }
        if ( notifier.isSendOnFailure() != true )
        {
            serializer.attribute( NAMESPACE, "sendOnFailure", String.valueOf( notifier.isSendOnFailure() ) );
        }
        if ( notifier.isSendOnSuccess() != true )
        {
            serializer.attribute( NAMESPACE, "sendOnSuccess", String.valueOf( notifier.isSendOnSuccess() ) );
        }
        if ( notifier.isSendOnWarning() != true )
        {
            serializer.attribute( NAMESPACE, "sendOnWarning", String.valueOf( notifier.isSendOnWarning() ) );
        }
        if ( notifier.getAddress() != null )
        {
            serializer.attribute( NAMESPACE, "address", notifier.getAddress() );
        }
        if ( ( notifier.getConfiguration() != null ) && ( notifier.getConfiguration().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "configuration" );
            for ( Iterator iter = notifier.getConfiguration().keySet().iterator(); iter.hasNext(); )
            {
                String key = (String) iter.next();
                String value = (String) notifier.getConfiguration().get( key );
                serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
            }
            serializer.endTag( NAMESPACE, "configuration" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeNotifier( Notifier, String, XmlSerializer )

    /**
     * Method writeOrganization.
     * 
     * @param organization
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeOrganization( Organization organization, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( organization.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", organization.getName() );
        }
        if ( organization.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", organization.getUrl() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeOrganization( Organization, String, XmlSerializer )

    /**
     * Method writeParent.
     * 
     * @param parent
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeParent( Parent parent, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( parent.getGroupId() != null )
        {
            serializer.attribute( NAMESPACE, "groupId", parent.getGroupId() );
        }
        if ( parent.getArtifactId() != null )
        {
            serializer.attribute( NAMESPACE, "artifactId", parent.getArtifactId() );
        }
        if ( parent.getVersion() != null )
        {
            serializer.attribute( NAMESPACE, "version", parent.getVersion() );
        }
        if ( ( parent.getRelativePath() != null ) && !parent.getRelativePath().equals( "../pom.xml" ) )
        {
            serializer.attribute( NAMESPACE, "relativePath", parent.getRelativePath() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeParent( Parent, String, XmlSerializer )

    /**
     * Method writePatternSet.
     * 
     * @param patternSet
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writePatternSet( PatternSet patternSet, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( patternSet.getIncludes() != null ) && ( patternSet.getIncludes().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "includes" );
            for ( Iterator iter = patternSet.getIncludes().iterator(); iter.hasNext(); )
            {
                String include = (String) iter.next();
                serializer.startTag( NAMESPACE, "include" ).text( include ).endTag( NAMESPACE, "include" );
            }
            serializer.endTag( NAMESPACE, "includes" );
        }
        if ( ( patternSet.getExcludes() != null ) && ( patternSet.getExcludes().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "excludes" );
            for ( Iterator iter = patternSet.getExcludes().iterator(); iter.hasNext(); )
            {
                String exclude = (String) iter.next();
                serializer.startTag( NAMESPACE, "exclude" ).text( exclude ).endTag( NAMESPACE, "exclude" );
            }
            serializer.endTag( NAMESPACE, "excludes" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writePatternSet( PatternSet, String, XmlSerializer )

    /**
     * Method writePlugin.
     * 
     * @param plugin
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writePlugin( Plugin plugin, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( plugin.getGroupId() != null ) && !plugin.getGroupId().equals( "org.apache.maven.plugins" ) )
        {
            serializer.attribute( NAMESPACE, "groupId", plugin.getGroupId() );
        }
        if ( plugin.getArtifactId() != null )
        {
            serializer.attribute( NAMESPACE, "artifactId", plugin.getArtifactId() );
        }
        if ( plugin.getVersion() != null )
        {
            serializer.attribute( NAMESPACE, "version", plugin.getVersion() );
        }
        if ( ( plugin.getExtensions() != null ) && !plugin.getExtensions().equals( "false" ) )
        {
            serializer.attribute( NAMESPACE, "extensions", plugin.getExtensions() );
        }
        if ( plugin.getInherited() != null )
        {
            serializer.attribute( NAMESPACE, "inherited", plugin.getInherited() );
        }
        if ( ( plugin.getExecutions() != null ) && ( plugin.getExecutions().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "executions" );
            for ( Iterator iter = plugin.getExecutions().iterator(); iter.hasNext(); )
            {
                PluginExecution o = (PluginExecution) iter.next();
                writePluginExecution( o, "execution", serializer );
            }
            serializer.endTag( NAMESPACE, "executions" );
        }
        if ( ( plugin.getDependencies() != null ) && ( plugin.getDependencies().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "dependencies" );
            for ( Iterator iter = plugin.getDependencies().iterator(); iter.hasNext(); )
            {
                Dependency o = (Dependency) iter.next();
                writeDependency( o, "dependency", serializer );
            }
            serializer.endTag( NAMESPACE, "dependencies" );
        }
        if ( plugin.getGoals() != null )
        {
            ((Xpp3Dom) plugin.getGoals()).writeToSerializer( NAMESPACE, serializer );
        }
        if ( plugin.getConfiguration() != null )
        {
            ((Xpp3Dom) plugin.getConfiguration()).writeToSerializer( NAMESPACE, serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writePlugin( Plugin, String, XmlSerializer )

    /**
     * Method writePluginConfiguration.
     * 
     * @param pluginConfiguration
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writePluginConfiguration( PluginConfiguration pluginConfiguration, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( pluginConfiguration.getPluginManagement() != null )
        {
            writePluginManagement( (PluginManagement) pluginConfiguration.getPluginManagement(), "pluginManagement", serializer );
        }
        if ( ( pluginConfiguration.getPlugins() != null ) && ( pluginConfiguration.getPlugins().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "plugins" );
            for ( Iterator iter = pluginConfiguration.getPlugins().iterator(); iter.hasNext(); )
            {
                Plugin o = (Plugin) iter.next();
                writePlugin( o, "plugin", serializer );
            }
            serializer.endTag( NAMESPACE, "plugins" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writePluginConfiguration( PluginConfiguration, String, XmlSerializer )

    /**
     * Method writePluginContainer.
     * 
     * @param pluginContainer
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writePluginContainer( PluginContainer pluginContainer, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( pluginContainer.getPlugins() != null ) && ( pluginContainer.getPlugins().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "plugins" );
            for ( Iterator iter = pluginContainer.getPlugins().iterator(); iter.hasNext(); )
            {
                Plugin o = (Plugin) iter.next();
                writePlugin( o, "plugin", serializer );
            }
            serializer.endTag( NAMESPACE, "plugins" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writePluginContainer( PluginContainer, String, XmlSerializer )

    /**
     * Method writePluginExecution.
     * 
     * @param pluginExecution
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writePluginExecution( PluginExecution pluginExecution, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( pluginExecution.getId() != null ) && !pluginExecution.getId().equals( "default" ) )
        {
            serializer.attribute( NAMESPACE, "id", pluginExecution.getId() );
        }
        if ( pluginExecution.getPhase() != null )
        {
            serializer.attribute( NAMESPACE, "phase", pluginExecution.getPhase() );
        }
        if ( pluginExecution.getInherited() != null )
        {
            serializer.attribute( NAMESPACE, "inherited", pluginExecution.getInherited() );
        }
        if ( ( pluginExecution.getGoals() != null ) && ( pluginExecution.getGoals().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "goals" );
            for ( Iterator iter = pluginExecution.getGoals().iterator(); iter.hasNext(); )
            {
                String goal = (String) iter.next();
                serializer.startTag( NAMESPACE, "goal" ).text( goal ).endTag( NAMESPACE, "goal" );
            }
            serializer.endTag( NAMESPACE, "goals" );
        }
        if ( pluginExecution.getConfiguration() != null )
        {
            ((Xpp3Dom) pluginExecution.getConfiguration()).writeToSerializer( NAMESPACE, serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writePluginExecution( PluginExecution, String, XmlSerializer )

    /**
     * Method writePluginManagement.
     * 
     * @param pluginManagement
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writePluginManagement( PluginManagement pluginManagement, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( pluginManagement.getPlugins() != null ) && ( pluginManagement.getPlugins().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "plugins" );
            for ( Iterator iter = pluginManagement.getPlugins().iterator(); iter.hasNext(); )
            {
                Plugin o = (Plugin) iter.next();
                writePlugin( o, "plugin", serializer );
            }
            serializer.endTag( NAMESPACE, "plugins" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writePluginManagement( PluginManagement, String, XmlSerializer )

    /**
     * Method writePrerequisites.
     * 
     * @param prerequisites
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writePrerequisites( Prerequisites prerequisites, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( prerequisites.getMaven() != null ) && !prerequisites.getMaven().equals( "2.0" ) )
        {
            serializer.attribute( NAMESPACE, "maven", prerequisites.getMaven() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writePrerequisites( Prerequisites, String, XmlSerializer )

    /**
     * Method writeProfile.
     * 
     * @param profile
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeProfile( Profile profile, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( profile.getId() != null ) && !profile.getId().equals( "default" ) )
        {
            serializer.attribute( NAMESPACE, "id", profile.getId() );
        }
        if ( profile.getActivation() != null )
        {
            writeActivation( (Activation) profile.getActivation(), "activation", serializer );
        }
        if ( profile.getBuild() != null )
        {
            writeBuildBase( (BuildBase) profile.getBuild(), "build", serializer );
        }
        if ( ( profile.getModules() != null ) && ( profile.getModules().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "modules" );
            for ( Iterator iter = profile.getModules().iterator(); iter.hasNext(); )
            {
                String module = (String) iter.next();
                serializer.startTag( NAMESPACE, "module" ).text( module ).endTag( NAMESPACE, "module" );
            }
            serializer.endTag( NAMESPACE, "modules" );
        }
        if ( profile.getDistributionManagement() != null )
        {
            writeDistributionManagement( (DistributionManagement) profile.getDistributionManagement(), "distributionManagement", serializer );
        }
        if ( ( profile.getProperties() != null ) && ( profile.getProperties().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "properties" );
            for ( Iterator iter = profile.getProperties().keySet().iterator(); iter.hasNext(); )
            {
                String key = (String) iter.next();
                String value = (String) profile.getProperties().get( key );
                serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
            }
            serializer.endTag( NAMESPACE, "properties" );
        }
        if ( profile.getDependencyManagement() != null )
        {
            writeDependencyManagement( (DependencyManagement) profile.getDependencyManagement(), "dependencyManagement", serializer );
        }
        if ( ( profile.getDependencies() != null ) && ( profile.getDependencies().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "dependencies" );
            for ( Iterator iter = profile.getDependencies().iterator(); iter.hasNext(); )
            {
                Dependency o = (Dependency) iter.next();
                writeDependency( o, "dependency", serializer );
            }
            serializer.endTag( NAMESPACE, "dependencies" );
        }
        if ( ( profile.getRepositories() != null ) && ( profile.getRepositories().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "repositories" );
            for ( Iterator iter = profile.getRepositories().iterator(); iter.hasNext(); )
            {
                Repository o = (Repository) iter.next();
                writeRepository( o, "repository", serializer );
            }
            serializer.endTag( NAMESPACE, "repositories" );
        }
        if ( ( profile.getPluginRepositories() != null ) && ( profile.getPluginRepositories().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "pluginRepositories" );
            for ( Iterator iter = profile.getPluginRepositories().iterator(); iter.hasNext(); )
            {
                Repository o = (Repository) iter.next();
                writeRepository( o, "pluginRepository", serializer );
            }
            serializer.endTag( NAMESPACE, "pluginRepositories" );
        }
        if ( profile.getReports() != null )
        {
            ((Xpp3Dom) profile.getReports()).writeToSerializer( NAMESPACE, serializer );
        }
        if ( profile.getReporting() != null )
        {
            writeReporting( (Reporting) profile.getReporting(), "reporting", serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeProfile( Profile, String, XmlSerializer )

    /**
     * Method writeRelocation.
     * 
     * @param relocation
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeRelocation( Relocation relocation, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( relocation.getGroupId() != null )
        {
            serializer.attribute( NAMESPACE, "groupId", relocation.getGroupId() );
        }
        if ( relocation.getArtifactId() != null )
        {
            serializer.attribute( NAMESPACE, "artifactId", relocation.getArtifactId() );
        }
        if ( relocation.getVersion() != null )
        {
            serializer.attribute( NAMESPACE, "version", relocation.getVersion() );
        }
        if ( relocation.getMessage() != null )
        {
            serializer.attribute( NAMESPACE, "message", relocation.getMessage() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeRelocation( Relocation, String, XmlSerializer )

    /**
     * Method writeReportPlugin.
     * 
     * @param reportPlugin
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeReportPlugin( ReportPlugin reportPlugin, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( reportPlugin.getGroupId() != null ) && !reportPlugin.getGroupId().equals( "org.apache.maven.plugins" ) )
        {
            serializer.attribute( NAMESPACE, "groupId", reportPlugin.getGroupId() );
        }
        if ( reportPlugin.getArtifactId() != null )
        {
            serializer.attribute( NAMESPACE, "artifactId", reportPlugin.getArtifactId() );
        }
        if ( reportPlugin.getVersion() != null )
        {
            serializer.attribute( NAMESPACE, "version", reportPlugin.getVersion() );
        }
        if ( reportPlugin.getInherited() != null )
        {
            serializer.attribute( NAMESPACE, "inherited", reportPlugin.getInherited() );
        }
        if ( ( reportPlugin.getReportSets() != null ) && ( reportPlugin.getReportSets().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "reportSets" );
            for ( Iterator iter = reportPlugin.getReportSets().iterator(); iter.hasNext(); )
            {
                ReportSet o = (ReportSet) iter.next();
                writeReportSet( o, "reportSet", serializer );
            }
            serializer.endTag( NAMESPACE, "reportSets" );
        }
        if ( reportPlugin.getConfiguration() != null )
        {
            ((Xpp3Dom) reportPlugin.getConfiguration()).writeToSerializer( NAMESPACE, serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeReportPlugin( ReportPlugin, String, XmlSerializer )

    /**
     * Method writeReportSet.
     * 
     * @param reportSet
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeReportSet( ReportSet reportSet, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( ( reportSet.getId() != null ) && !reportSet.getId().equals( "default" ) )
        {
            serializer.attribute( NAMESPACE, "id", reportSet.getId() );
        }
        if ( reportSet.getInherited() != null )
        {
            serializer.attribute( NAMESPACE, "inherited", reportSet.getInherited() );
        }
        if ( ( reportSet.getReports() != null ) && ( reportSet.getReports().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "reports" );
            for ( Iterator iter = reportSet.getReports().iterator(); iter.hasNext(); )
            {
                String report = (String) iter.next();
                serializer.startTag( NAMESPACE, "report" ).text( report ).endTag( NAMESPACE, "report" );
            }
            serializer.endTag( NAMESPACE, "reports" );
        }
        if ( reportSet.getConfiguration() != null )
        {
            ((Xpp3Dom) reportSet.getConfiguration()).writeToSerializer( NAMESPACE, serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeReportSet( ReportSet, String, XmlSerializer )

    /**
     * Method writeReporting.
     * 
     * @param reporting
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeReporting( Reporting reporting, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( reporting.getExcludeDefaults() != null )
        {
            serializer.attribute( NAMESPACE, "excludeDefaults", reporting.getExcludeDefaults() );
        }
        if ( reporting.getOutputDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "outputDirectory", reporting.getOutputDirectory() );
        }
        if ( ( reporting.getPlugins() != null ) && ( reporting.getPlugins().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "plugins" );
            for ( Iterator iter = reporting.getPlugins().iterator(); iter.hasNext(); )
            {
                ReportPlugin o = (ReportPlugin) iter.next();
                writeReportPlugin( o, "plugin", serializer );
            }
            serializer.endTag( NAMESPACE, "plugins" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeReporting( Reporting, String, XmlSerializer )

    /**
     * Method writeRepository.
     * 
     * @param repository
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeRepository( Repository repository, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( repository.getId() != null )
        {
            serializer.attribute( NAMESPACE, "id", repository.getId() );
        }
        if ( repository.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", repository.getName() );
        }
        if ( repository.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", repository.getUrl() );
        }
        if ( ( repository.getLayout() != null ) && !repository.getLayout().equals( "default" ) )
        {
            serializer.attribute( NAMESPACE, "layout", repository.getLayout() );
        }
        if ( repository.getReleases() != null )
        {
            writeRepositoryPolicy( (RepositoryPolicy) repository.getReleases(), "releases", serializer );
        }
        if ( repository.getSnapshots() != null )
        {
            writeRepositoryPolicy( (RepositoryPolicy) repository.getSnapshots(), "snapshots", serializer );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeRepository( Repository, String, XmlSerializer )

    /**
     * Method writeRepositoryBase.
     * 
     * @param repositoryBase
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeRepositoryBase( RepositoryBase repositoryBase, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( repositoryBase.getId() != null )
        {
            serializer.attribute( NAMESPACE, "id", repositoryBase.getId() );
        }
        if ( repositoryBase.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", repositoryBase.getName() );
        }
        if ( repositoryBase.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", repositoryBase.getUrl() );
        }
        if ( ( repositoryBase.getLayout() != null ) && !repositoryBase.getLayout().equals( "default" ) )
        {
            serializer.attribute( NAMESPACE, "layout", repositoryBase.getLayout() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeRepositoryBase( RepositoryBase, String, XmlSerializer )

    /**
     * Method writeRepositoryPolicy.
     * 
     * @param repositoryPolicy
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeRepositoryPolicy( RepositoryPolicy repositoryPolicy, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( repositoryPolicy.getEnabled() != null )
        {
            serializer.attribute( NAMESPACE, "enabled", repositoryPolicy.getEnabled() );
        }
        if ( repositoryPolicy.getUpdatePolicy() != null )
        {
            serializer.attribute( NAMESPACE, "updatePolicy", repositoryPolicy.getUpdatePolicy() );
        }
        if ( repositoryPolicy.getChecksumPolicy() != null )
        {
            serializer.attribute( NAMESPACE, "checksumPolicy", repositoryPolicy.getChecksumPolicy() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeRepositoryPolicy( RepositoryPolicy, String, XmlSerializer )

    /**
     * Method writeResource.
     * 
     * @param resource
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeResource( Resource resource, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( resource.getTargetPath() != null )
        {
            serializer.attribute( NAMESPACE, "targetPath", resource.getTargetPath() );
        }
        if ( resource.getFiltering() != null )
        {
            serializer.attribute( NAMESPACE, "filtering", resource.getFiltering() );
        }
        if ( resource.getDirectory() != null )
        {
            serializer.attribute( NAMESPACE, "directory", resource.getDirectory() );
        }
        if ( ( resource.getIncludes() != null ) && ( resource.getIncludes().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "includes" );
            for ( Iterator iter = resource.getIncludes().iterator(); iter.hasNext(); )
            {
                String include = (String) iter.next();
                serializer.startTag( NAMESPACE, "include" ).text( include ).endTag( NAMESPACE, "include" );
            }
            serializer.endTag( NAMESPACE, "includes" );
        }
        if ( ( resource.getExcludes() != null ) && ( resource.getExcludes().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "excludes" );
            for ( Iterator iter = resource.getExcludes().iterator(); iter.hasNext(); )
            {
                String exclude = (String) iter.next();
                serializer.startTag( NAMESPACE, "exclude" ).text( exclude ).endTag( NAMESPACE, "exclude" );
            }
            serializer.endTag( NAMESPACE, "excludes" );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeResource( Resource, String, XmlSerializer )

    /**
     * Method writeScm.
     * 
     * @param scm
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeScm( Scm scm, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( scm.getConnection() != null )
        {
            serializer.attribute( NAMESPACE, "connection", scm.getConnection() );
        }
        if ( scm.getDeveloperConnection() != null )
        {
            serializer.attribute( NAMESPACE, "developerConnection", scm.getDeveloperConnection() );
        }
        if ( ( scm.getTag() != null ) && !scm.getTag().equals( "HEAD" ) )
        {
            serializer.attribute( NAMESPACE, "tag", scm.getTag() );
        }
        if ( scm.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", scm.getUrl() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeScm( Scm, String, XmlSerializer )

    /**
     * Method writeSite.
     * 
     * @param site
     * @param serializer
     * @param tagName
     * @throws java.io.IOException
     */
    private void writeSite( Site site, String tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( NAMESPACE, tagName );
        if ( site.getId() != null )
        {
            serializer.attribute( NAMESPACE, "id", site.getId() );
        }
        if ( site.getName() != null )
        {
            serializer.attribute( NAMESPACE, "name", site.getName() );
        }
        if ( site.getUrl() != null )
        {
            serializer.attribute( NAMESPACE, "url", site.getUrl() );
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writeSite( Site, String, XmlSerializer )

}
