Policy p1 = new Policy();
ExactlyOne ea = new ExactlyOne();
p1.addPolicyComponent(ea);
All all = new All();
ea.addPolicyComponent(all);
all.addPolicyComponent(new PrimitiveAssertion(new QName(uri1, "a1")));
all = new All();
ea.addPolicyComponent(all);
all.addPolicyComponent(new PrimitiveAssertion(new QName(uri1, "a2")));
String uri2 = "http://a.b.c";
Policy p2 = new Policy();
ea = new ExactlyOne();
p2.addPolicyComponent(ea);
all = new All();
ea.addPolicyComponent(all);
all.addPolicyComponent(new PrimitiveAssertion(new QName(uri2, "x1")));
all = new All();
ea.addPolicyComponent(all);
all.addPolicyComponent(new PrimitiveAssertion(new QName(uri2, "x2")));
System.out.println("p1:");
PolicyUtils.printPolicyComponent(p1);
System.out.println();
System.out.println("p2:");