func (p *PaloAlto) TemplateStacks() (*TemplateStacks, error) {
	var temps TemplateStacks
	ver := splitSWVersion(p.SoftwareVersion)
	xpath := "/config/devices/entry//template-stack"
	if p.DeviceType != "panorama" {
		return nil, errors.New("template stacks can only be listed on a Panorama device")
	}
	if ver[0] < 7 {
		return nil, errors.New("you must be running version 7.0.0 or higher to use template stacks")
	}
	_, tData, errs := r.Get(p.URI).Query(fmt.Sprintf("type=config&action=get&xpath=%s&key=%s", xpath, p.Key)).End()
	if errs != nil {
		return nil, errs[0]
	}
	if err := xml.Unmarshal([]byte(tData), &temps); err != nil {
		return nil, err
	}
	if temps.Status != "success" {
		return nil, fmt.Errorf("error code %s: %s", temps.Code, errorCodes[temps.Code])
	}
	return &temps, nil
}
TemplateStacks returns information about all of the template stacks in Panorama, and what templates, devices
are assigned to them. This is ONLY available on Panorama version 7.0.0 and higher.
package panos
import (
	"encoding/xml"
	"errors"
	"fmt"
	"strings"
)
type Templates struct {
	XMLName   xml.Name   `xml:"response"`
	Status    string     `xml:"status,attr"`
	Code      string     `xml:"code,attr"`
	Templates []Template `xml:"result>template>entry"`
}
type Template struct {
	Name        string   `xml:"name,attr"`
	Description string   `xml:"description"`
	Devices     []Serial `xml:"devices>entry"`
}
type TemplateStacks struct {
	XMLName   xml.Name        `xml:"response"`
	Status    string          `xml:"status,attr"`
	Code      string          `xml:"code,attr"`
	Templates []TemplateStack `xml:"result>template-stack>entry"`
}
type TemplateStack struct {
	Name        string   `xml:"name,attr"`
	Description string   `xml:"description"`
	Members     []string `xml:"templates>member"`
	Devices     []Serial `xml:"devices>entry"`
}
func (p *PaloAlto) Templates() (*Templates, error) {
	var temps Templates
	xpath := "/config/devices/entry//template"
	if p.DeviceType != "panorama" {
		return nil, errors.New("templates can only be listed on a Panorama device")
	}
	_, tData, errs := r.Get(p.URI).Query(fmt.Sprintf("type=config&action=get&xpath=%s&key=%s", xpath, p.Key)).End()
	if errs != nil {
		return nil, errs[0]
	}
	if err := xml.Unmarshal([]byte(tData), &temps); err != nil {
		return nil, err
	}
	if temps.Status != "success" {
		return nil, fmt.Errorf("error code %s: %s", temps.Code, errorCodes[temps.Code])
	}
	return &temps, nil
}