If a system namespace (e.g. xs, xsi, xslt) is excluded
using exclude-result-prefixes (e.g. by specifying exclude-
result-prefixes="#all"), and if the namespace is used in
the name of an attribute (e.g. xsi:type), then it will be
excluded from the output even if it is actually required
to make the result document namespace-well-formed.
Exclude-result-prefixes should be ignored in the case of
namespaces that are actually required in the result tree.
Source code fixed, test case added.