func (p *Printer) createAttrPrefix(attr *xml.Attr) string {
	if prefix := p.attrPrefix[attr.Name.Space]; prefix != "" {
		return prefix
	}
	if attr.Name.Space == nsXML {
		return "xml"
	}
	if p.attrPrefix == nil {
		p.attrPrefix = make(map[string]string)
	}
	ns, prefix := attr.Name.Space, attr.Name.Local
	if attr.Name.Space == "xmlns" {
		ns, prefix = attr.Value, attr.Name.Local
	}
	p.attrPrefix[ns] = prefix
	return attr.Name.Space
}
createAttrPrefix finds the name space prefix attribute to use for the given name space,
defining a new prefix if necessary. It returns the prefix.
package xml
import (
	"bufio"
	"encoding/xml"
)
const (
	nsXML = "http://www.w3.org/XML/1998/namespace"
)
type Printer struct {
	*bufio.Writer
	AutoClose      bool
	SkipAttrEscape bool
	attrPrefix     map[string]string  
}