So I am working on a SOAP driver, and for the challenge I am trying to
do it without XSLT.

Now as it turns out, I am almost complete, and no XSLT (except one
stylesheet left, the one that removes the
<soapenv:Envelope><soapenv:Body> nodes from the doc.

I was starting to have some regrets, as I was watching my
do-append-xml-element, do-append-xml-text and set-xml-attribute tokens
take on the order of 20-30 milliseconds each, and I am using a fair
number of them. (Less than you would think though!)

But then I started a migrate, where the SOAP service returned 2279
objects, each with like 20 sub nodes.

The one default stylesheet is taking about 17-20 minutes at 100% CPU on
my VM (2 cores, on a 2.4Ghz Intel server class box), just to strip those
nodes off.

Once past there, I have policy that uses each node, queries back for
info about the user, and that is completing in about 12 minutes!!

So I have a fair amount of policy, including 1-2 queries per object,
taking LESS time, than one stylesheet!

All the stylesheet does is select the nodes under the soapenv:Body, and
any op-data nodes, and copy it through.

There is the usual header stuff, the identity transform below, and this
in the middle:

<!-- *********************** -->
<!-- Strip off SOAP header -->
<!-- *********************** -->
<xsl:template match="soapenv:Envelope">
<xsl:message>Input: Strip SOAP Headers</xsl:message>
<!-- ignore this element but process all children -->
<xsl:apply-templates select="soapenv:Body/*"/>
<xsl:apply-templates select="operation-data"/>

Is there a more efficient way to handle it? Ya, I should chunk the
queries to smaller amounts, but that is harder than it sounds at the moment.

But more generally, should XSLT or Policy be faster? (As a general rule?)

I was surprised to see this!

I will probably just ditch the stylesheet, since I can live with the
soap envelope in the docs, since I am reformatting them in Policy anyway.

Or is there overhead in selecting nodes that have additional name spaces
versus those without additional name spaces?

Fun times!