You didn't introduce this, but your pull request made me notice it.  :)  I think we have a problem here.  I think this will be problematic depending on the XSLT processor used.  Since the <security-domains> element in the XSLT has no namespace specified, the processor has two choices.

1) Use the default namespace currently in scope on the element being processed
2) Use the default namespace currently in scope on the parent element of <security-domains> in the XSLT document itself (which in this case is <xsl:template match="...">).

I believe the correct behavior for an XSLT processor is (2) which would result in the element being stored in the target document with the wrong namespace (since the default namespace in-scope would be xmlns="").

I don't think there is a solution to this beyond having two separate templates (I'm assuming based on your changes that the "as" namespace in wildfly is newer than the one in eap 6.1).

I'm happy to accept the pull request and then make changes if you like.