DOM is for both input and output
New documents are created with a parser-specific API
A serializer + output format converts the DOM to a byte stream