Improve portability of "xml" test

The "xml" test was failing on OS X, FreeBSD, and RHEL 6 due to inconsistent
output from the "toprettyxml" function.  Solution is to add more filtering
of output.raw.xml file (ignore blank lines and leading whitespace, and
split lines after the '>' character).