package dom

import (
	
	
)

type Document struct {
	root *Element
	PrettyPrint bool
	Indentation string
	DocType bool
}

func () *Document {
	return &Document{ PrettyPrint: false, Indentation: "  ", DocType: true }
}

func ( *Document) ( *Element) {
	.parent = nil
	.root = 
}

func ( *Document) () string {
	var  bytes.Buffer
	if .DocType {
		fmt.Fprintln(&, `<?xml version="1.0" encoding="utf-8" ?>`)
	}
	
	if .root != nil {
		.root.Bytes(&, .PrettyPrint, .Indentation, 0)
	}
	
	return string(.Bytes())
}