resolves issue #125, clean CRLF from endlines
move line cleaning to top of block
strip outer blank lines on document (for valid XML)
Merge pull request #126 from mojavelinux/clean-crlf

Resolve issue #125, clean CRLF from end of lines