title: Creating a SOAP request with PHP - how do I add attributes to the XML tags?
body: <p>I am trying to generate the following XML in my SOAP call:</p>
  
  <pre><code>&lt;CResponse&gt;
      &lt;ID&gt;int&lt;/ID&gt;
      &lt;Response Action="Apply"&gt;
          &lt;Question ID="$someint"&gt;
              &lt;Responses&gt;
                  &lt;Response ID="$someotherint" /&gt;
                  &lt;Response ID="$yetanotherint" /&gt;
              &lt;/Responses&gt;
          &lt;/Question&gt;
      &lt;/Response&gt;
  &lt;/CResponse&gt;
  </code></pre>
  
  <p>I can create most of the call just fine - I've finally picked up that nested arrays are my friends - but I have no idea how to add those <code>ID="$int"</code> and <code>Action="Apply"</code> attributes to the various tags.  I'm sure this is fairly easy, but I just can't figure it out.</p>
  
  <p>TIA.</p>