func TestMarshalXMLStruct(t *testing.T) {
	type Group struct {
		People  []*person `xml:"person"`
		XMLName xml.Name  `xml:"group"`
	}
	input := &Group{People: testPeople[:5]}
	b, err := marshalXML(input)
	if err != nil {
		t.Fatal(err)
	}
	if !bytes.Equal(b[:len(xml.Header)], []byte(xml.Header)) {
		t.Fatal("XML marshaling did not start with a proper header")
	}
	var parsed Group
	decoder := xml.NewDecoder(bytes.NewReader(b))
	if err := decoder.Decode(&parsed); err != nil {
		t.Fatal(err)
	}
	if len(parsed.People) != len(input.People) {
		t.Fatal("len error. Got:", len(parsed.People), "Wanted:", len(input.People))
	}
	for i, c := range parsed.People {
		if c.String() != input.People[i].String() {
			t.Fatal("Got:", c.String(), "Wanted:", input.People[i].String())
		}
	}
}
Checking if marshalXML inserts a header and outputs a valid xml document
when used with a struct.
package rst
import (
	"bytes"
	"encoding/xml"
	"fmt"
	"mime"
	"net/http"
	"testing"
)