code: private File generatePomFile()
              throws MojoExecutionException
      {
          Model model = generateModel();
  
          Writer writer = null;
          try
          {
              File pomFile = File.createTempFile( "mvninstall", ".pom" );
  
              writer = WriterFactory.newXmlWriter(pomFile);
              new MavenXpp3Writer().write( writer, model );
  
              return pomFile;
          }
          catch ( IOException e )
          {
              throw new MojoExecutionException( "Error writing temporary POM file: " + e.getMessage(), e );
          }
          finally
          {
              IOUtil.close(writer);
          }
      }
docs: Generates a (temporary) POM file from the plugin configuration. It's the responsibility of the caller to delete
  the generated file when no longer needed.
  
  @return The path to the generated POM file, never <code>null</code>.
  @throws MojoExecutionException If the POM file could not be generated.