title: Gradle maven publish generates invalid POM with duplicated attributes
body: <p>I have a gradle multimodule project using the maven publish plugin.
  The publish task fails as the maven publish plugin generates an invalid POM.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xmlns="http://www.w3.org/2000/xmlns/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xmlns="http://www.w3.org/2000/xmlns/"&gt;
    &lt;modelVersion xmlns="http://maven.apache.org/POM/4.0.0"&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId xmlns="http://maven.apache.org/POM/4.0.0"&gt;com.example&lt;/groupId&gt;
    &lt;artifactId xmlns="http://maven.apache.org/POM/4.0.0"&gt;application&lt;/artifactId&gt;
    &lt;version xmlns="http://maven.apache.org/POM/4.0.0"&gt;0.2.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging xmlns="http://maven.apache.org/POM/4.0.0"&gt;pom&lt;/packaging&gt;
    &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
          &lt;version&gt;2.2.1.RELEASE&lt;/version&gt;
          &lt;scope&gt;import&lt;/scope&gt;
          &lt;type&gt;pom&lt;/type&gt;
        &lt;/dependency&gt;
      &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;
  &lt;/project xmlns="http://maven.apache.org/POM/4.0.0"&gt;
  </code></pre>
  
  <p>It clearly is invalid as there are duplicated attributes in the project starting element and the closing element has 'xmlns="http://maven.apache.org/POM/4.0.0"'</p>
  
  <p>I tried gradle 5.6.0 and 6.1.1 with the same outcome.</p>
  
  <p>Any idea how to fix this and what could be the cause?</p>