public void loadXmlResource(Package pkg, String name) throws IOException {
		String pkgName = pkg.getName();
		pkgName = pkgName.replace('.', '/');

		String resourceName = "/" + pkgName + "/" + name;
		InputStream is = getClass().getResourceAsStream(resourceName);
		if (is == null) {
			throw new IOException("Could not find resource: " + resourceName);
		}
		BufferedReader br = new BufferedReader(new InputStreamReader(is));
		String line = "";
		while (line != null) {
			line = br.readLine();
			if (line != null) {
				xmlList.add(line);
			}
		}
		br.close();
	}
Read an XML file as a resource.

@param pkg
           where resource resides
@param name
           name of the resource that is in the given package
@throws IOException thrown if there was a problem accessing the xml resource.
Ghidra/Features/Base/src/main/java/ghidra/util/xml/XmlTestHelper.java