diff --git a/service_provider.go b/service_provider.go index 30b35670..fa75f706 100644 --- a/service_provider.go +++ b/service_provider.go @@ -1672,7 +1672,11 @@ func elementToBytes(el *etree.Element) ([]byte, error) { doc := etree.NewDocument() doc.SetRoot(el.Copy()) for space, uri := range namespaces { - doc.Root().CreateAttr("xmlns:"+space, uri) + if space == "" { + doc.Root().CreateAttr("xmlns", uri) + } else { + doc.Root().CreateAttr("xmlns:"+space, uri) + } } return doc.WriteToBytes()