func (tn *tagNode) appendTextNode(text string) *textNode {
	trimmedText := strings.TrimSpace(text)
	if trimmedText == "" {
		return nil
	}
	ntn := newTextNode(trimmedText)
	tn.appendChild(ntn)
	return ntn
}
appendTextNode creates a text node, appends it as last child
and returns it.
package sml
import (
	"bytes"
	"fmt"
	"regexp"
	"strings"
)
type tagNode struct {
	tag      []string
	children []Node
}
func newTagNode(tag string) (*tagNode, error) {
	vtag, err := ValidateTag(tag)
	if err != nil {
		return nil, err
	}
	return &tagNode{
		tag:      vtag,
		children: []Node{},
	}, nil
}
func (tn *tagNode) appendTagNode(tag string) (*tagNode, error) {
	ntn, err := newTagNode(tag)
	if err != nil {
		return nil, err
	}
	tn.appendChild(ntn)
	return ntn, nil
}