public static IOD load(String uri) throws IOException {
        if (uri.startsWith("resource:")) {
            try {
                uri = ResourceLocator.getResource(uri.substring(9), IOD.class);
            } catch (NullPointerException npe) {
                throw new FileNotFoundException(uri);
            }
        } else if (uri.indexOf(':') < 2) {
            uri = new File(uri).toURI().toString();
        }
        IOD iod = new IOD();
        iod.parse(uri);
        iod.trimToSize();
        return iod;
    }
@Test
    public void testValidateCode() throws Exception {
        IOD iod = IOD.load("resource:code-iod.xml");
        Attributes attrs = new Attributes(2);
        attrs.newSequence(Tag.ConceptNameCodeSequence, 1).add(
                new Code("CV-9991", "99DCM4CHE", null, "CM-9991").toItem());
        Attributes contentNode = new Attributes(2);
        contentNode.newSequence(Tag.ConceptNameCodeSequence, 1).add(
                new Code("CV-9992", "99DCM4CHE", null, "CM-9992").toItem());
        contentNode.newSequence(Tag.ConceptCodeSequence, 1).add(
                new Code("CV-9993", "99DCM4CHE", null, "CM-9993").toItem());
        attrs.newSequence(Tag.ContentSequence, 1).add(contentNode);
        ValidationResult result = attrs.validate(iod);
        assertTrue(result.isValid());
    }