Modifying the Xsl property of the CoreResultsWebPart using the Web Part editor is straight-forward. But doing the same thing programmatically is a nuisance. In many situations you end up with an InvalidOperation exception.
The reason for this trouble is the getter of the XslHash property:
Of course, the _BeforeOnInit field is "true" when you try to modify the CoreResultsWebPart using the LimitedWebPartManager.
The easiest way to solve this involves a bit of reflection:
typeof
(SearchResultsBaseWebPart).GetField("_BeforeOnInit", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(wp, false);
After this you can set the Xsl property.
HTH!