trim feed input to remove illegal space or linebreaks in XML documents

I encountered some RSS feeds that had linebreaks or spaces in front of the XML declaration, which causes SimpleXMLElement to error out with "String could not be parsed as XML".  When Chrome encounters a similar problem with spaces in front of the XML declaration they  output this error:

>This page contains the following errors:
>
>error on line 2 at column 6: XML declaration allowed only at the start of the document

So to solve this I suggest trimming the resulting rss source.