title: Setting custom tag in Soap Security Header (Spring WS)
body: <p>I'm using SpringWSTemplate Client to send a message. 
  Using the method <code>sendSourceAndReceiveToResult(Source requestPayload, WebServiceMessageCallback requestCallback, Result responseResult)</code>.</p>
  
  <p>In this I'm setting a few security credentials using <code>wss4jsecurityinterceptor</code>.
  But currently I'm in need of setting a custom tag (<code>RegisterKey</code>) inside <code>usernametoken</code> as similar to shown below.</p>
  
  <pre><code>&lt;wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;
      &lt;wsse:UsernameToken wsu:Id="UsernameToken-11" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;
          &lt;wsse:Username&gt;test&lt;/wsse:Username&gt;
          &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;a287645857cfaaddf82e2d333651b3e0&lt;/wsse:Password&gt;
          &lt;wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"&gt;oKGlwEkbkhYJH6upsbiqeQ==&lt;/wsse:Nonce&gt;
          &lt;wsu:Created&gt;2011-10-25T13:10:11.958Z&lt;/wsu:Created&gt;
          &lt;RegisterKey&gt;UUUiiiIUBGGGTTT&lt;/RegisterKey&gt;
      &lt;/wsse:UsernameToken&gt;
  &lt;/wsse:Security&gt;
  </code></pre>
  
  <p>I tried using Transformer (java.xml.transform.transformer) to inject the custom tag, but it's getting injected straight to <code>SoapHeader</code> and not within <code>UsernameToken</code>.</p>