title: How to write multiple different xml namespace in one element in PHP
body: <p>I want to build this xml</p>
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; 
  xmlns:sec=&quot;http://xml.amadeus.com/2010/06/Security_v1&quot;
  xmlns:link=&quot;http://wsdl.amadeus.com/2010/06/ws/Link_v1&quot;
  xmlns:ses=&quot;http://xml.amadeus.com/2010/06/Session_v3&quot; 
  xmlns:ns=&quot;http://www.iata.org/IATA/2015/00/2018.1/AirShoppingRQ&quot;&gt;
  </code></pre>
  <p>here is my php code</p>
  <pre><code>    public function build() {
          $document = new DOMDocument(&quot;1.0&quot;, &quot;utf-8&quot;);
          $root = $document-&gt;createElementNS(
              &quot;http://schemas.xmlsoap.org/soap/envelope/&quot;,
              &quot;soapenv:Envelope&quot;
          );
          $root-&gt;setAttributeNS(
              &quot;http://schemas.xmlsoap.org/soap/envelope/&quot;,
              &quot;xmlns&quot;,
              &quot;sec&quot;
          );
  
          $document-&gt;appendChild($root);
  
          return $document;
      }
  </code></pre>
  <p>my function returns this xml</p>
  <pre><code>  xml: &quot;&quot;&quot;
      &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
      &lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; soapenv:xmlns=&quot;sec&quot;/&gt;
      &quot;&quot;&quot;
  </code></pre>
  <p>I want soapenv element to have 4 different xmlns. but setting attributes is not working.</p>