Xml validation in payload inspection

May I have any link or document on how to write custom plugin for basic xml format validation.