You cannot. Remember that the content of P elements can consist of just PCDATA. Which can just be "plain text". And even if you have a piece of data that validates against an HTML DTD, you still cannot know whether the author intended it as HTML, or as plain text.
If you need to know, you either have to use some heuristics (for instance, it "validates", either against a DTD or the more usual "my browser doesn't barf on it"), or ask the user.
Comment on Re: Distinguish between HTML and Plain text