I want to wrap the children nodes of <foo/>
that are not <bar/>
or <baz/>
with <corge/>
.
Note: <bar/>
and <baz/>
will always be the first child nodes of <foo/>
Converting this:
<root>
<foo>
<bar>bar</bar>
<baz>baz</baz>
<qux>qux</qux>
<grault>grault</grault>
</foo>
<foo>
<bar>bar</bar>
<baz>baz</baz>
<qux>qux</qux>
<quux>quux</quux>
</foo>
</root>
to this:
<root>
<foo>
<bar>bar</bar>
<baz>baz</baz>
<corge>
<qux>qux</qux>
<grault>grault</grault>
</corge>
</foo>
<foo>
<bar>bar</bar>
<baz>baz</baz>
<corge>
<qux>qux</qux>
<quux>quux</quux>
</corge>
</foo>
</root>
What is a good way to do this using XSL?