I ran this code[1] and got these results[2]. As you can see, the resuting
xml is very different from the original. Is there anything I can do to make
the result look like the original?

[1] code

require 'soap/processor'

str = <<SOAP
<soap:Envelope
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"
  xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">
  <soap:Header>
    <wsse:Security>
      <wsse:UsernameToken>
        <wsse:Username>USERNAME</wsse:Username>
        <wsse:Password
Type="wsse:PasswordDigest">PASSWORDDIGEST</wsse:Password>
        <wsse:Nonce>NONCE</wsse:Nonce>
        <wsu:Created>2003-09-08T05:52:36Z</wsu:Created>
      </wsse:UsernameToken>
    </wsse:Security>
  </soap:Header>
  <soap:Body>
    <DELETE xmlns="http://schemas.xmlsoap.org/wsdl/http/"/>
  </soap:Body>
</soap:Envelope>
SOAP

env = SOAP::Processor.unmarshal(str)
puts SOAP::Processor.marshal(env)

[2] result

<?xml version="1.0" encoding="us-ascii" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Header>
    <n1:item xmlns:n1="http://schemas.xmlsoap.org/ws/2002/07/secext"
        env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <UsernameToken xsi:type="n1:UsernameToken">
        <Username xsi:type="xsd:string">USERNAME</Username>
        <Password xsi:type="xsd:string"
            Type="wsse:PasswordDigest">PASSWORDDIGEST</Password>
        <Nonce xsi:type="xsd:string">NONCE</Nonce>
        <Created xsi:type="xsd:string">2003-09-08T05:52:36Z</Created>
      </UsernameToken>
    </n1:item>
  </env:Header>
  <env:Body>
    <n2:DELETE xmlns:n2="http://schemas.xmlsoap.org/wsdl/http/"
        xsi:type="n2:DELETE"
        env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    </n2:DELETE>
  </env:Body>
</env:Envelope>