func SharedStyle(id string, children ...Element) *SharedElement {
	return newSharedE("Style", id, children)
}
SharedStyle returns a new shared Style element.
package kml
import (
	"encoding/xml"
	"io"
	"strconv"
)
const Namespace = "http://www.opengis.net/kml/2.2"
var (
	coordinatesStartElement = xml.StartElement{
		Name: xml.Name{
			Local: "coordinates",
		},
	}
	coordinatesEndElement = coordinatesStartElement.End()
)
type Coordinate struct {
	Lon, Lat, Alt float64
}
type Vec2 struct {
	X, Y           float64
	XUnits, YUnits UnitsEnum
}
type CoordinatesElement struct {
	coordinates []Coordinate
}
type CoordinatesArrayElement struct {
	coordinates [][]float64
}
type CoordinatesFlatElement struct {
	flatCoords               []float64
	offset, end, stride, dim int
}
func (ce *CoordinatesElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	if err := e.EncodeToken(coordinatesStartElement); err != nil {
		return err
	}
	for i, c := range ce.coordinates {
		s := ""
		if i != 0 {
			s = " "
		}
		s += strconv.FormatFloat(c.Lon, 'f', -1, 64) + "," + strconv.FormatFloat(c.Lat, 'f', -1, 64)
		if c.Alt != 0 {
			s += "," + strconv.FormatFloat(c.Alt, 'f', -1, 64)
		}
		if err := e.EncodeToken(xml.CharData([]byte(s))); err != nil {
			return err
		}
	}
	return e.EncodeToken(coordinatesEndElement)
}
func (ce *CoordinatesElement) Write(w io.Writer) error {
	return write(w, "", "  ", ce)
}
func (ce *CoordinatesElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, ce)
}
func (cae *CoordinatesArrayElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	if err := e.EncodeToken(coordinatesStartElement); err != nil {
		return err
	}
	for i, c := range cae.coordinates {
		s := ""
		if i != 0 {
			s = " "
		}
		s += strconv.FormatFloat(c[0], 'f', -1, 64) + "," + strconv.FormatFloat(c[1], 'f', -1, 64)
		if len(c) > 2 && c[2] != 0 {
			s += "," + strconv.FormatFloat(c[2], 'f', -1, 64)
		}
		if err := e.EncodeToken(xml.CharData([]byte(s))); err != nil {
			return err
		}
	}
	return e.EncodeToken(coordinatesEndElement)
}
func (cae *CoordinatesArrayElement) Write(w io.Writer) error {
	return write(w, "", "  ", cae)
}
func (cae *CoordinatesArrayElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, cae)
}
func (cfe *CoordinatesFlatElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	if err := e.EncodeToken(coordinatesStartElement); err != nil {
		return err
	}
	for i := cfe.offset; i < cfe.end; i += cfe.stride {
		s := ""
		if i != cfe.offset {
			s = " "
		}
		s += strconv.FormatFloat(cfe.flatCoords[i], 'f', -1, 64) + "," + strconv.FormatFloat(cfe.flatCoords[i+1], 'f', -1, 64)
		if cfe.dim > 2 && cfe.flatCoords[i+2] != 0 {
			s += "," + strconv.FormatFloat(cfe.flatCoords[i+2], 'f', -1, 64)
		}
		if err := e.EncodeToken(xml.CharData([]byte(s))); err != nil {
			return err
		}
	}
	return e.EncodeToken(coordinatesEndElement)
}
func (cfe *CoordinatesFlatElement) Write(w io.Writer) error {
	return write(w, "", "  ", cfe)
}
func (cfe *CoordinatesFlatElement) WriteIndent(w io.Writer, prefix, indent string) error {
	return write(w, prefix, indent, cfe)
}
func Coordinates(value ...Coordinate) *CoordinatesElement {
	return &CoordinatesElement{coordinates: value}
}
func CoordinatesArray(value ...[]float64) *CoordinatesArrayElement {
	return &CoordinatesArrayElement{coordinates: value}
}
func CoordinatesFlat(flatCoords []float64, offset, end, stride, dim int) *CoordinatesFlatElement {
	return &CoordinatesFlatElement{
		flatCoords: flatCoords,
		offset:     offset,
		end:        end,
		stride:     stride,
		dim:        dim,
	}
}
func LinkSnippet(maxLines int, value string) *SimpleElement {
	return &SimpleElement{
		StartElement: xml.StartElement{
			Name: xml.Name{Local: "linkSnippet"},
			Attr: []xml.Attr{
				{Name: xml.Name{Local: "maxLines"}, Value: strconv.Itoa(maxLines)},
			},
		},
		Value: value,
	}
}
func Schema(id, name string, children ...Element) *SharedElement {
	return &SharedElement{
		CompoundElement: CompoundElement{
			StartElement: xml.StartElement{
				Name: xml.Name{Local: "Schema"},
				Attr: []xml.Attr{
					{Name: xml.Name{Local: "id"}, Value: id},
					{Name: xml.Name{Local: "name"}, Value: name},
				},
			},
			Children: children,
		},
		ID: id,
	}
}
func SchemaData(schemaURL string, children ...Element) *CompoundElement {
	return &CompoundElement{
		StartElement: xml.StartElement{
			Name: xml.Name{Local: "SchemaData"},
			Attr: []xml.Attr{
				{Name: xml.Name{Local: "schemaUrl"}, Value: schemaURL},
			},
		},
		Children: children,
	}
}