Here's a quick rundown of my adventures over the last ten minutes:
Zeroth of all, when an XML file is not "well-formed", it means that, no matter what the DTD may be, the file can't be valid: mis-nested tags, missing tags, or something like that.
First (and all this was on a Window system), PHP segfaulted on me when I ran your code. Ick. Coredump all over the floor. Seems since 4.0.6 you don't pass the XML itself, but - as it turns out - filenames.
$xml = "c:\sample.xml";
$xsl = "c:\sample.xsl";
Second, I get the error you describe; on line 5, which isn't a huge amount of help... Okay ... more prolonged staring at the manual page (not one of the most well-written, to be sure) ... Um, there's a note here just before the user notes saything that "file:// is needed in front of path" if I'm using Windows. Um, yeah, whatever .... the only "paths" I see would be those two filenames, so let's have a crack:
$xml = "file://c:\sample.xml";
$xsl = "file://c:\sample.xsl";
Third try:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3c.org/TR/
xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IT WORKS!!!!!</title>
</head>
<body>
<h1>yay this works</h1>
</body>
</html>
I guess that's a success. Dunno why it was going wrong the way it was - maybe a null string (from a faulty "path') doesn't qualify as well-formed XML ... yep, §2.1 of the XML1.0 Spec states as much. That answers that then.
Does that get you any closer to a solution? I recognise most of that is probably useless on a non-Windows box.