pyang (manual page) is an extensible YANG validator written in Python. It can be used standalone as a validator of YANG modules, or to generate YIN, YANG, DSDL and XSD from YANG and YIN. It can also be integrated in other applications, which can, for example, generate vendor-specific stub code. Validation of instance XML documents (datastore contents or NETCONF PDUs) using pyang is explained in DSDLMappingTutorial and yang2dsdlmanual page.
pyang can also be used to generate UML diagrams from YANG data models. See UML Output Example.