func MergeBodies(bodies []Body) Body {
	if len(bodies) == 0 {
		return emptyBody
	}
	var newLen int
	var flatten bool
	for _, body := range bodies {
		if children, merged := body.(mergedBodies); merged {
			newLen += len(children)
			flatten = true
		} else {
			newLen++
		}
	}
	if !flatten {  
		return mergedBodies(bodies)
	}
	if newLen == 0 {
		return emptyBody
	}
	new := make([]Body, 0, newLen)
	for _, body := range bodies {
		if children, merged := body.(mergedBodies); merged {
			new = append(new, children...)
		} else {
			new = append(new, body)
		}
	}
	return mergedBodies(new)
}
MergeBodies is like MergeFiles except it deals directly with bodies, rather
than with entire files.
package hcl
import (
	"fmt"
)
func MergeFiles(files []*File) Body {
	var bodies []Body
	for _, file := range files {
		bodies = append(bodies, file.Body)
	}
	return MergeBodies(bodies)
}