diff --git a/entry.go b/entry.go index 4eb7dd6..9086c72 100644 --- a/entry.go +++ b/entry.go @@ -249,3 +249,13 @@ func (e *Entry) Check() error { return nil } + +// ToXML converts the Feed to XML. It returns a string and an error. +func (e *Entry) ToXML(encoding string) (string, error) { + xml, err := xml.MarshalIndent(e, "", " ") + if err != nil { + return "", fmt.Errorf("error xml encoding entry: %v", err) + } + + return fmt.Sprintln(``) + string(xml), nil +}