diff --git a/libraries/common_syndication_parser.inc b/libraries/common_syndication_parser.inc
index a0c1e31991a351d2a497d9f751a9eb4ae2434c9e..a4d373e510953efc072007758eebd71416001fdc 100644
--- a/libraries/common_syndication_parser.inc
+++ b/libraries/common_syndication_parser.inc
@@ -19,6 +19,10 @@
  *  stdClass The structured datas extracted from the feed.
  */
 function common_syndication_parser_parse($string) {
+  // SimpleXML can only deal with XML declaration at the start of the document,
+  // so remove any surrounding whitespace.
+  $string = trim($string);
+
   @ $xml = simplexml_load_string($string, NULL, LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_NOCDATA);
 
   // Got a malformed XML.