PDS4 labels are written in XML, and enforced by so-called dictionaries. Each dictionary consists of a schema (.xsd file) and Schematron (.sch) file.
Dictionaries are built using a PDS-provided tool called LDDTool, for which some knowledge of XPath and XQuery is useful.
In fact, XQuery is generally a very useful thing to know when working with PDS4 labels, since it can be used to very easy extract information programmatically.
This page aims to capture some examples, hints and tips on how to use XPath and XQuery, both standalone and in LDDTool.