The script parses a given XSD file, and an accompanying, conforming XML file. If any matching Processing Instructions are found in the XSD file (default name "elementCount"), then XML Elements in the scope specified, and with the name specified, are counted. The parent Element of the Processing Instruction has the count injected into a named attribute. The purpose of this is to allow the design of data in an object-oriented manner (XML), but then to store the static data in a data-oriented manner at run-time. At run-time, the Element count can be used to initialise dynamic data structures to store the exact number of Elements (e.g. an array).