Fixed a bug that was causing builds to fail when certain invalid XML was being converted to a DOM Document.