Some refactoring and robustness improvements for XmlDocumentationExtensi...

...ons, unit tests

This PR improves the formatting of XMLDocumentation as exposed in Dynamo, cleaning up white space and errant new lines.

This also fixes MAGN-3033.  

@ikeough