Does anyone have any experience with implementing textile into their own home brew cms?

I am simply trying to add the textile function to a form so that it will parse my content, making it xhtml compliant. I have looked everywhere for an answer to this including the textpattern forums with no luck.

I would greatly appreciate if anyone has any pointers.