X-definition is an open-source Java API that can be used to extract data from XML files regardless of their size. It will not compel the Java Virtual Machine to complain that it is out of heap memory, nor does it even require that your Java code step through the parts of your XML in the order of their occurrence until the location of the data you need is reached. It requires little more than a markup model of your XML document, and about 90 to 120 seconds of processing time for each gigabyte of XML data.
In this article, we'll download a modest (2.5 GB) file from data.discogs.com and extract data from it using a minimum of code. Our X-definition instructions will amount to the following: