If type is defined in main package then it's model name has a unwanted prefix "main", ie
type Foo struct{ Bar string }
api.AddEndpoint(endpoint.New(http.MethodGet, "/foo", "test",
endpoint.Handler(h_test),
endpoint.Produces("text/xml; charset=utf-8"),
endpoint.Response(http.StatusOK, Foo{}, "foo"),
))
<?xml version="1.0" encoding="UTF-8"?>
<mainFoo>
<Bar>string</Bar>
</mainFoo>