Rewrote pretty print to use DOM Level 3 Load and Save (LS).