Added _is_xmldoc() to standardize the test. Mirrored script attribute to merged result for properly handling self-ref.
Added _is_xmldoc() to standardize the test. Mirrored script attribute to merged result for properly handling self-ref.

cjungmann/schemafw,cjungmann/schemafw,cjungmann/schemafw,cjungmann/schemafw,cjungmann/schemafw