func EncodeToNode(element interface{}, rootName string, opts EncoderToNodeOpts) (*Node, error) {
	rValue := reflect.ValueOf(element)
	node := &Node{Name: rootName}
	encoder := encoderToNode{EncoderToNodeOpts: opts}
	err := encoder.setNodeValue(node, rValue)
	if err != nil {
		return nil, err
	}
	return node, nil
}
EncodeToNode converts an element to a node.
element -> nodes.
package parser
import (
	"fmt"
	"reflect"
	"strconv"
	"strings"
)
type EncoderToNodeOpts struct {
	TagName            string
	OmitEmpty          bool
	AllowSliceAsStruct bool
}