class DefaultTargetPlatformConfigurationReader {

    protected void readExtraRequirements(TargetPlatformConfiguration result, Xpp3Dom resolverDom)
            throws BuildFailureException {
        Xpp3Dom requirementsDom = resolverDom.getChild("extraRequirements");
        if (requirementsDom == null) {
            return;
        }

        for (Xpp3Dom requirementDom : requirementsDom.getChildren("requirement")) {
            Dependency d = new Dependency();
            if (requirementDom.getChild("type") == null) {
                throw new BuildFailureException(
                        "Element <type> is missing in <extraRequirements><requirement> section.");
            }
            if (requirementDom.getChild("id") == null) {
                throw new BuildFailureException("Element <id> is missing in <extraRequirements><requirement> section.");
            }
            if (requirementDom.getChild("versionRange") == null) {
                throw new BuildFailureException(
                        "Element <versionRange> is missing in <extraRequirements><requirement> section.");
            }
            d.setType(requirementDom.getChild("type").getValue());
            d.setArtifactId(requirementDom.getChild("id").getValue());
            d.setVersion(requirementDom.getChild("versionRange").getValue());
            result.addExtraRequirement(d);
        }
    }

}