killbill-memoizeit

Details

diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultBlock.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultBlock.java
new file mode 100644
index 0000000..85b5bd6
--- /dev/null
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultBlock.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2014 The Billing Project, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlIDREF;
+
+import org.killbill.billing.catalog.api.Block;
+import org.killbill.billing.catalog.api.InternationalPrice;
+import org.killbill.billing.catalog.api.Unit;
+import org.killbill.billing.util.config.catalog.ValidatingConfig;
+import org.killbill.billing.util.config.catalog.ValidationErrors;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class DefaultBlock extends ValidatingConfig<StandaloneCatalog> implements Block {
+
+    @XmlElement(required = true)
+    @XmlIDREF
+    private DefaultUnit unit;
+
+    @XmlElement(required = true)
+    private Double size;
+
+    @XmlElement(required = true)
+    private DefaultInternationalPrice prices;
+
+    // Not defined in catalog
+    private DefaultUsage usage;
+
+    @Override
+    public Unit getUnit() {
+        return unit;
+    }
+
+    @Override
+    public Double getSize() {
+        return size;
+    }
+
+    @Override
+    public InternationalPrice getPrice() {
+        return prices;
+    }
+
+    @Override
+    public ValidationErrors validate(final StandaloneCatalog root, final ValidationErrors errors) {
+        return errors;
+    }
+
+    public DefaultBlock setUnit(final DefaultUnit unit) {
+        this.unit = unit;
+        return this;
+    }
+
+    public DefaultBlock setSize(final Double size) {
+        this.size = size;
+        return this;
+    }
+
+    public DefaultBlock setPrice(final DefaultInternationalPrice prices) {
+        this.prices = prices;
+        return this;
+    }
+
+    public DefaultBlock setUsage(final DefaultUsage usage) {
+        this.usage = usage;
+        return this;
+    }
+}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultLimit.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultLimit.java
index cc7ee58..4f3cd2d 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultLimit.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultLimit.java
@@ -37,7 +37,9 @@ public class DefaultLimit extends ValidatingConfig<StandaloneCatalog> implements
     
     @XmlElement(required = false)
     private Double min;
-    
+
+    // Not defined in catalog
+    private DefaultUsage usage;
     
     /* (non-Javadoc)
      * @see org.killbill.billing.catalog.Limit#getUnit()
@@ -88,4 +90,24 @@ public class DefaultLimit extends ValidatingConfig<StandaloneCatalog> implements
         }
         return true;
     }
+
+    public DefaultLimit setUnit(final DefaultUnit unit) {
+        this.unit = unit;
+        return this;
+    }
+
+    public DefaultLimit setMax(final Double max) {
+        this.max = max;
+        return this;
+    }
+
+    public DefaultLimit setMin(final Double min) {
+        this.min = min;
+        return this;
+    }
+
+    public DefaultLimit setUsage(final DefaultUsage usage) {
+        this.usage = usage;
+        return this;
+    }
 }
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhase.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhase.java
index 9cfd5d1..ea16bd8 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhase.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhase.java
@@ -82,11 +82,13 @@ public class DefaultPlanPhase extends ValidatingConfig<StandaloneCatalog> implem
 
     @Override
     public boolean compliesWithLimits(final String unit, final double value) {
+        // First check usage section
         for (DefaultUsage usage : usages) {
             if (!usage.compliesWithLimits(unit, value)) {
                 return false;
             }
         }
+        // Second, check if there are limits defined at the product section.
         return plan.getProduct().compliesWithLimits(unit, value);
     }
 
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultTier.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultTier.java
new file mode 100644
index 0000000..fec873b
--- /dev/null
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultTier.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2014 The Billing Project, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Block;
+import org.killbill.billing.catalog.api.InternationalPrice;
+import org.killbill.billing.catalog.api.Tier;
+import org.killbill.billing.catalog.api.UsageType;
+import org.killbill.billing.util.config.catalog.ValidatingConfig;
+import org.killbill.billing.util.config.catalog.ValidationError;
+import org.killbill.billing.util.config.catalog.ValidationErrors;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class DefaultTier extends ValidatingConfig<StandaloneCatalog> implements Tier {
+
+    @XmlElementWrapper(name = "limits", required = false)
+    @XmlElement(name = "limit", required = true)
+    private DefaultLimit[] limits = new DefaultLimit[0];
+
+    @XmlElementWrapper(name = "blocks", required = false)
+    @XmlElement(name = "block", required = true)
+    private DefaultBlock[] blocks = new DefaultBlock[0];
+
+    // Used to define a fixed price for the whole tier section
+    @XmlElement(required = false)
+    private DefaultInternationalPrice fixedPrice;
+
+    // Used to define a recurring price for the whole tier section
+    @XmlElement(required = false)
+    private DefaultInternationalPrice recurringPrice;
+
+
+    // Not defined in catalog
+    private DefaultUsage usage;
+
+    @Override
+    public DefaultLimit[] getLimits() {
+        return limits;
+    }
+
+    @Override
+    public Block[] getBlocks() {
+        return blocks;
+    }
+
+    @Override
+    public InternationalPrice getFixedPrice() {
+        return fixedPrice;
+    }
+
+    @Override
+    public InternationalPrice getRecurringPrice() {
+        return recurringPrice;
+    }
+
+    public DefaultTier setLimits(final DefaultLimit[] limits) {
+        this.limits = limits;
+        return this;
+    }
+
+    public DefaultTier setBlocks(final DefaultBlock[] blocks) {
+        this.blocks = blocks;
+        return this;
+    }
+
+    public DefaultTier setUsage(final DefaultUsage usage) {
+        this.usage = usage;
+        return this;
+    }
+
+    public DefaultTier setFixedPrice(final DefaultInternationalPrice fixedPrice) {
+        this.fixedPrice = fixedPrice;
+        return this;
+    }
+
+    public DefaultTier setRecurringPrice(final DefaultInternationalPrice recurringPrice) {
+        this.recurringPrice = recurringPrice;
+        return this;
+    }
+
+    @Override
+    public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
+
+        if (usage.getBillingMode() == BillingMode.IN_ARREAR && usage.getUsageType() == UsageType.CAPACITY && limits.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ARREAR CAPACITY] section of phase %s needs to define some limits",
+                                                         usage.getPhase().toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        if (usage.getBillingMode() == BillingMode.IN_ARREAR && usage.getUsageType() == UsageType.CONSUMABLE && blocks.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ARREAR CONSUMABLE] section of phase %s needs to define some blocks",
+                                                         usage.getPhase().toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        validateCollection(catalog, errors, limits);
+        return errors;
+    }
+}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultUsage.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultUsage.java
index 2b22691..2841609 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultUsage.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultUsage.java
@@ -1,64 +1,169 @@
+/*
+ * Copyright 2014 The Billing Project, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
 package org.killbill.billing.catalog;
 
 import java.net.URI;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 
+import org.killbill.billing.catalog.api.BillingMode;
 import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.Block;
+import org.killbill.billing.catalog.api.InternationalPrice;
 import org.killbill.billing.catalog.api.Limit;
 import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Tier;
 import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.catalog.api.UsageType;
 import org.killbill.billing.util.config.catalog.ValidatingConfig;
+import org.killbill.billing.util.config.catalog.ValidationError;
 import org.killbill.billing.util.config.catalog.ValidationErrors;
 
 @XmlAccessorType(XmlAccessType.NONE)
 public class DefaultUsage extends ValidatingConfig<StandaloneCatalog> implements Usage {
 
+    @XmlAttribute(required = true)
+    private BillingMode billingMode;
+
+    @XmlAttribute(required = true)
+    private UsageType usageType;
+
     @XmlElement(required = true)
     private BillingPeriod billingPeriod;
 
+    // Used for when billing usage IN_ADVANCE & CAPACITY
     @XmlElementWrapper(name = "limits", required = false)
     @XmlElement(name = "limit", required = true)
     private DefaultLimit[] limits = new DefaultLimit[0];
 
+    // Used for when billing usage IN_ADVANCE & CONSUMABLE
+    @XmlElementWrapper(name = "blocks", required = false)
+    @XmlElement(name = "block", required = true)
+    private DefaultBlock[] blocks = new DefaultBlock[0];
+
+    // Used for when billing usage IN_ARREAR
+    @XmlElementWrapper(name = "tiers", required = false)
+    @XmlElement(name = "tier", required = true)
+    private DefaultTier[] tiers = new DefaultTier[0];
+
+    // Used to define a fixed price for the whole usage section -- bundle several limits/blocks of units.
+    @XmlElement(required = false)
+    private DefaultInternationalPrice fixedPrice;
+
+    // Used to define a recurring price for the whole usage section -- bundle several limits/blocks of units.
+    @XmlElement(required = false)
+    private DefaultInternationalPrice recurringPrice;
+
+
+    // Not exposed in xml.
+    private PlanPhase phase;
+
+    @Override
+    public BillingMode getBillingMode() {
+        return billingMode;
+    }
+
+    @Override
+    public UsageType getUsageType() {
+        return usageType;
+    }
+
     @Override
     public BillingPeriod getBillingPeriod() {
         return billingPeriod;
     }
 
-    // Not exposed in xml.
-    private PlanPhase phase;
-
     @Override
     public boolean compliesWithLimits(final String unit, final double value) {
-        for (DefaultLimit limit : limits) {
-            if (!limit.getUnit().getName().equals(unit)) {
-                continue;
-            }
-            if (!limit.compliesWith(value)) {
-                return false;
-            }
+        final Limit limit = findLimit(unit);
+        if (limit != null && !limit.compliesWith(value)) {
+            return false;
         }
         return true;
     }
 
     @Override
-    public ValidationErrors validate(final StandaloneCatalog root, final ValidationErrors errors) {
-        validateCollection(root, errors, limits);
+    public Limit[] getLimits() {
+        return limits;
+    }
+
+    @Override
+    public Tier[] getTiers() {
+        return tiers;
+    }
+
+    @Override
+    public Block[] getBlocks() {
+        return blocks;
+    }
+
+    @Override
+    public InternationalPrice getFixedPrice() {
+        return fixedPrice;
+    }
+
+    @Override
+    public InternationalPrice getRecurringPrice() {
+        return recurringPrice;
+    }
+
+    @Override
+    public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
+        if (billingMode == BillingMode.IN_ADVANCE && usageType == UsageType.CAPACITY && limits.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ADVANCE CAPACITY] section of phase %s needs to define some limits",
+                                                         phase.toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        if (billingMode == BillingMode.IN_ADVANCE && usageType == UsageType.CONSUMABLE && blocks.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ADVANCE CONSUMABLE] section of phase %s needs to define some blocks",
+                                                         phase.toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+
+        if (billingMode == BillingMode.IN_ARREAR && tiers.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ARREAR] section of phase %s needs to define some tiers",
+                                                         phase.toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        validateCollection(catalog, errors, limits);
+        validateCollection(catalog, errors, tiers);
         return errors;
     }
 
     @Override
     public void initialize(final StandaloneCatalog root, final URI uri) {
+        for (DefaultLimit limit : limits) {
+            limit.initialize(root, uri);
+            limit.setUsage(this);
+        }
+        for (DefaultBlock block : blocks) {
+            block.initialize(root, uri);
+            block.setUsage(this);
+        }
 
+        for (DefaultTier tier : tiers) {
+            tier.initialize(root, uri);
+            tier.setUsage(this);
+        }
     }
 
-    @Override
-    public DefaultLimit[] getLimits() {
-        return limits;
+    public PlanPhase getPhase() {
+        return phase;
     }
 
     public DefaultUsage setBillingPeriod(final BillingPeriod billingPeriod) {
@@ -66,17 +171,48 @@ public class DefaultUsage extends ValidatingConfig<StandaloneCatalog> implements
         return this;
     }
 
+    public DefaultUsage setBillingMode(final BillingMode billingMode) {
+        this.billingMode = billingMode;
+        return this;
+    }
+
+    public DefaultUsage setUsageType(final UsageType usageType) {
+        this.usageType = usageType;
+        return this;
+    }
+
     public DefaultUsage setPhase(final PlanPhase phase) {
         this.phase = phase;
         return this;
     }
 
-    public void setLimits(final DefaultLimit[] limits) {
+    public DefaultUsage setTiers(final DefaultTier[] tiers) {
+        this.tiers = tiers;
+        return this;
+    }
+
+
+    public DefaultUsage setBlocks(final DefaultBlock[] blocks) {
+        this.blocks = blocks;
+        return this;
+    }
+
+    public DefaultUsage setLimits(final DefaultLimit[] limits) {
         this.limits = limits;
+        return this;
     }
 
-    protected Limit findLimit(String unit) {
+    public DefaultUsage setFixedPrice(final DefaultInternationalPrice fixedPrice) {
+        this.fixedPrice = fixedPrice;
+        return this;
+    }
 
+    public DefaultUsage setRecurringPrice(final DefaultInternationalPrice recurringPrice) {
+        this.recurringPrice = recurringPrice;
+        return this;
+    }
+
+    protected Limit findLimit(String unit) {
         for (Limit limit : limits) {
             if (limit.getUnit().getName().equals(unit)) {
                 return limit;
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/io/TestXMLReader.java b/catalog/src/test/java/org/killbill/billing/catalog/io/TestXMLReader.java
index 1361c88..447e2ed 100644
--- a/catalog/src/test/java/org/killbill/billing/catalog/io/TestXMLReader.java
+++ b/catalog/src/test/java/org/killbill/billing/catalog/io/TestXMLReader.java
@@ -16,25 +16,230 @@
 
 package org.killbill.billing.catalog.io;
 
+import java.math.BigDecimal;
+
 import org.killbill.billing.catalog.CatalogTestSuiteNoDB;
 import org.killbill.billing.catalog.StandaloneCatalog;
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.CatalogApiException;
+import org.killbill.billing.catalog.api.Currency;
+import org.killbill.billing.catalog.api.Plan;
+import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.catalog.api.UsageType;
 import org.killbill.billing.util.config.catalog.XMLLoader;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
 import com.google.common.io.Resources;
 
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+
 public class TestXMLReader extends CatalogTestSuiteNoDB {
 
     @Test(groups = "fast")
     public void testCatalogLoad() {
         try {
+
+            XMLLoader.getObjectFromString(Resources.getResource("catalogSample.xml").toExternalForm(), StandaloneCatalog.class);
+
             XMLLoader.getObjectFromString(Resources.getResource("SpyCarBasic.xml").toExternalForm(), StandaloneCatalog.class);
             XMLLoader.getObjectFromString(Resources.getResource("SpyCarAdvanced.xml").toExternalForm(), StandaloneCatalog.class);
             XMLLoader.getObjectFromString(Resources.getResource("WeaponsHire.xml").toExternalForm(), StandaloneCatalog.class);
             XMLLoader.getObjectFromString(Resources.getResource("WeaponsHireSmall.xml").toExternalForm(), StandaloneCatalog.class);
+            XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+
+    @Test(groups = "fast")
+    public void testUsageCapacityInAdvance() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "capacity-in-advance-monthly");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.MONTHLY);
+            assertEquals(usage.getUsageType(), UsageType.CAPACITY);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ADVANCE);
+
+            assertEquals(usage.getBlocks().length, 0);
+            assertEquals(usage.getTiers().length, 0);
+
+            assertEquals(usage.getLimits().length, 1);
+            assertEquals(usage.getLimits()[0].getUnit().getName(), "members");
+            assertEquals(usage.getLimits()[0].getMax(), new Double("100"));
+
+            assertEquals(usage.getRecurringPrice().getPrices().length, 1);
+            assertEquals(usage.getRecurringPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getRecurringPrice().getPrices()[0].getValue(), new BigDecimal("100.00"));
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+    @Test(groups = "fast")
+    public void testUsageConsumableInAdvancePrepayCredit() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "consumable-in-advance-prepay-credit-monthly");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.MONTHLY);
+            assertEquals(usage.getUsageType(), UsageType.CONSUMABLE);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ADVANCE);
+
+            assertEquals(usage.getLimits().length, 0);
+            assertEquals(usage.getTiers().length, 0);
+
+            assertEquals(usage.getBlocks().length, 1);
+
+            assertEquals(usage.getBlocks()[0].getUnit().getName(), "cell-phone-minutes");
+            assertEquals(usage.getBlocks()[0].getSize(), new Double("1000"));
+
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices().length, 1);
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices()[0].getValue(), new BigDecimal("0.10"));
         } catch (Exception e) {
             Assert.fail(e.toString());
         }
     }
+
+
+    @Test(groups = "fast")
+    public void testUsageConsumableInAdvanceTopUp() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "consumable-in-advance-topup");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.NO_BILLING_PERIOD);
+            assertEquals(usage.getUsageType(), UsageType.CONSUMABLE);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ADVANCE);
+
+            assertEquals(usage.getLimits().length, 0);
+            assertEquals(usage.getTiers().length, 0);
+
+            assertEquals(usage.getBlocks().length, 1);
+
+            assertEquals(usage.getBlocks()[0].getUnit().getName(), "fastrack-tokens");
+            assertEquals(usage.getBlocks()[0].getSize(), new Double("10"));
+
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices().length, 1);
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices()[0].getValue(), new BigDecimal("0.10"));
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+
+    @Test(groups = "fast")
+    public void testUsageCapacityInArrear() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "capacity-in-arrear");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.MONTHLY);
+            assertEquals(usage.getUsageType(), UsageType.CAPACITY);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ARREAR);
+
+            assertEquals(usage.getLimits().length, 0);
+            assertEquals(usage.getBlocks().length, 0);
+
+            assertEquals(usage.getTiers().length, 2);
+
+
+            assertEquals(usage.getTiers()[0].getLimits().length, 2);
+            assertEquals(usage.getTiers()[0].getLimits()[0].getUnit().getName(), "bandwith-meg-sec");
+            assertEquals(usage.getTiers()[0].getLimits()[0].getMax(), new Double("100"));
+            assertEquals(usage.getTiers()[0].getLimits()[1].getUnit().getName(), "members");
+            assertEquals(usage.getTiers()[0].getLimits()[1].getMax(), new Double("500"));
+            assertEquals(usage.getTiers()[0].getFixedPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[0].getFixedPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[0].getFixedPrice().getPrices()[0].getValue(), new BigDecimal("0.007"));
+            assertEquals(usage.getTiers()[0].getRecurringPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[0].getRecurringPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[0].getRecurringPrice().getPrices()[0].getValue(), new BigDecimal("0.8"));
+
+            assertEquals(usage.getTiers()[1].getLimits()[0].getUnit().getName(), "bandwith-meg-sec");
+            assertEquals(usage.getTiers()[1].getLimits()[0].getMax(), new Double("100"));
+            assertEquals(usage.getTiers()[1].getLimits()[1].getUnit().getName(), "members");
+            assertEquals(usage.getTiers()[1].getLimits()[1].getMax(), new Double("1000"));
+            assertEquals(usage.getTiers()[1].getFixedPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[1].getFixedPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[1].getFixedPrice().getPrices()[0].getValue(), new BigDecimal("0.4"));
+            assertEquals(usage.getTiers()[1].getRecurringPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[1].getRecurringPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[1].getRecurringPrice().getPrices()[0].getValue(), new BigDecimal("1.2"));
+
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+
+    @Test(groups = "fast")
+    public void testUsageConsumableInArrear() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "consumable-in-arrear");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.MONTHLY);
+            assertEquals(usage.getUsageType(), UsageType.CONSUMABLE);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ARREAR);
+
+            assertEquals(usage.getLimits().length, 0);
+            assertEquals(usage.getBlocks().length, 0);
+
+            assertEquals(usage.getTiers().length, 1);
+
+
+            assertEquals(usage.getTiers()[0].getBlocks().length, 2);
+            assertEquals(usage.getTiers()[0].getBlocks()[0].getUnit().getName(), "cell-phone-minutes");
+            assertEquals(usage.getTiers()[0].getBlocks()[0].getSize(), new Double("1000"));
+            assertEquals(usage.getTiers()[0].getBlocks()[0].getPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[0].getBlocks()[0].getPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[0].getBlocks()[0].getPrice().getPrices()[0].getValue(), new BigDecimal("0.5"));
+
+            assertEquals(usage.getTiers()[0].getBlocks()[1].getUnit().getName(), "Mbytes");
+            assertEquals(usage.getTiers()[0].getBlocks()[1].getSize(), new Double("512"));
+            assertEquals(usage.getTiers()[0].getBlocks()[1].getPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[0].getBlocks()[1].getPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[0].getBlocks()[1].getPrice().getPrices()[0].getValue(), new BigDecimal("0.3"));
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+
+    private Usage[] getUsages(final StandaloneCatalog catalog, final String planName) throws CatalogApiException {
+        final Plan plan  = catalog.findCurrentPlan(planName);
+        assertNotNull(plan);
+        final PlanPhase phase = plan.getFinalPhase();
+        assertNotNull(phase);
+        final Usage[] usages = phase.getUsages();
+        return usages;
+    }
 }
diff --git a/catalog/src/test/resources/WeaponsHireSmall.xml b/catalog/src/test/resources/WeaponsHireSmall.xml
index 04bc40c..3a686dd 100644
--- a/catalog/src/test/resources/WeaponsHireSmall.xml
+++ b/catalog/src/test/resources/WeaponsHireSmall.xml
@@ -122,8 +122,8 @@
                     </recurringPrice>
                 </recurring>
                 <usages>
-                    <usage>
-                        <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
+                    <usage billingMode="IN_ADVANCE" usageType="CAPACITY">
+                        <billingPeriod>MONTHLY</billingPeriod>
                         <limits>
                             <limit>
                                 <unit>targets</unit>
@@ -134,6 +134,20 @@
                                 <max>20</max>
                             </limit>
                         </limits>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>1.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>0.95</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>1.95</value>
+                            </price>
+                        </recurringPrice>
                     </usage>
                 </usages>
             </finalPhase>
@@ -212,7 +226,7 @@
                     </recurringPrice>
                 </recurring>
                 <usages>
-                    <usage>
+                    <usage billingMode="IN_ADVANCE" usageType="CAPACITY">
                         <billingPeriod>ANNUAL</billingPeriod>
                         <limits>
                             <limit>
@@ -220,6 +234,20 @@
                                 <max>200</max>
                             </limit>
                         </limits>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>1.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>0.95</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>1.95</value>
+                            </price>
+                        </recurringPrice>
                     </usage>
                 </usages>
             </finalPhase>
diff --git a/entitlement/src/test/resources/catalog.xml b/entitlement/src/test/resources/catalog.xml
index 973afd0..0221374 100644
--- a/entitlement/src/test/resources/catalog.xml
+++ b/entitlement/src/test/resources/catalog.xml
@@ -1,12 +1,19 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- ~ Copyright 2010-2011 Ning, Inc. ~ ~ Ning licenses this file to you 
-	under the Apache License, version 2.0 ~ (the "License"); you may not use 
-	this file except in compliance with the ~ License. You may obtain a copy 
-	of the License at: ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless 
-	required by applicable law or agreed to in writing, software ~ distributed 
-	under the License is distributed on an "AS IS" BASIS, WITHOUT ~ WARRANTIES 
-	OR CONDITIONS OF ANY KIND, either express or implied. See the ~ License for 
-	the specific language governing permissions and limitations ~ under the License. -->
+<!--
+  ~ Copyright 2010-2013 Ning, Inc.
+  ~
+  ~ Ning licenses this file to you under the Apache License, version 2.0
+  ~ (the "License"); you may not use this file except in compliance with the
+  ~ License.  You may obtain a copy of the License at:
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+  ~ License for the specific language governing permissions and limitations
+  ~ under the License.
+  -->
 
 <!-- Use cases covered so far: Tiered Product (Pistol/Shotgun/Assault-Rifle) 
 	Multiple changeEvent plan policies Multiple PlanAlignment (see below, trial 
@@ -17,812 +24,976 @@
 	and a one off (refurbish-maintenance) Phan with more than 2 phase (gunclub 
 	discount plans) Use Cases to do: Tiered Add On Riskfree period -->
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
-	<effectiveDate>2011-01-01T00:00:00+00:00</effectiveDate>
-	<catalogName>Firearms</catalogName>
+    <effectiveDate>2011-01-01T00:00:00+00:00</effectiveDate>
+    <catalogName>Firearms</catalogName>
 
-	<currencies>
-		<currency>USD</currency>
-		<currency>EUR</currency>
-		<currency>GBP</currency>
-	</currencies>
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
 
-	<products>
-		<product name="Pistol">
-			<category>BASE</category>
-		</product>
-		<product name="Shotgun">
-			<category>BASE</category>
-			<available>
-				<addonProduct>Telescopic-Scope</addonProduct>
-				<addonProduct>Laser-Scope</addonProduct>
-			</available>
-		</product>
-		<product name="Assault-Rifle">
-			<category>BASE</category>
-			<included>
-				<addonProduct>Telescopic-Scope</addonProduct>
-			</included>
-			<available>
-				<addonProduct>Laser-Scope</addonProduct>
-			</available>
-		</product>
-		<product name="Telescopic-Scope">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Laser-Scope">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Holster">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Extra-Ammo">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Refurbish-Maintenance">
-			<category>ADD_ON</category>
-		</product>
-	</products>
+    <currencies>
+        <currency>USD</currency>
+        <currency>EUR</currency>
+        <currency>GBP</currency>
+    </currencies>
 
-	<rules>
-		<changePolicy>
-			<changePolicyCase>
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-                       <changePolicyCase>
-                                <toPriceList>rescue</toPriceList>
-                                <policy>END_OF_TERM</policy>
-                        </changePolicyCase>
-			<changePolicyCase>
-				<toProduct>Assault-Rifle</toProduct>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-			<changePolicyCase>
-				<fromProduct>Pistol</fromProduct>
-				<toProduct>Shotgun</toProduct>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-			<changePolicyCase>
-				<fromBillingPeriod>MONTHLY</fromBillingPeriod>
-				<toBillingPeriod>ANNUAL</toBillingPeriod>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-			<changePolicyCase>
-				<fromBillingPeriod>ANNUAL</fromBillingPeriod>
-				<toBillingPeriod>MONTHLY</toBillingPeriod>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-			<changePolicyCase>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-		</changePolicy>
-		<changeAlignment>
-			<changeAlignmentCase>
-				<toPriceList>rescue</toPriceList>
-				<alignment>CHANGE_OF_PLAN</alignment>
-			</changeAlignmentCase>
-			<changeAlignmentCase>
-				<fromPriceList>rescue</fromPriceList>
-				<toPriceList>rescue</toPriceList>
-				<alignment>CHANGE_OF_PRICELIST</alignment>
-			</changeAlignmentCase>
-			<changeAlignmentCase>
-				<alignment>START_OF_SUBSCRIPTION</alignment>
-			</changeAlignmentCase>
-		</changeAlignment>
-		<cancelPolicy>
-			<cancelPolicyCase>
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</cancelPolicyCase>
-			<cancelPolicyCase>
-				<policy>END_OF_TERM</policy>
-			</cancelPolicyCase>
-		</cancelPolicy>
-		<createAlignment>
-			<createAlignmentCase>
-				<product>Laser-Scope</product>
-				<alignment>START_OF_SUBSCRIPTION</alignment>
-			</createAlignmentCase>
-			<createAlignmentCase>
-				<alignment>START_OF_BUNDLE</alignment>
-			</createAlignmentCase>
-		</createAlignment>
-		<billingAlignment>
-			<billingAlignmentCase>
-				<productCategory>ADD_ON</productCategory>
-				<alignment>BUNDLE</alignment>
-			</billingAlignmentCase>
-			<billingAlignmentCase>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<alignment>SUBSCRIPTION</alignment>
-			</billingAlignmentCase>
-			<billingAlignmentCase>
-				<alignment>ACCOUNT</alignment>
-			</billingAlignmentCase>
-		</billingAlignment>
-		<priceList>
-			<priceListCase>
-				<fromPriceList>rescue</fromPriceList>
-				<toPriceList>DEFAULT</toPriceList>
-			</priceListCase>
-		</priceList>
-	</rules>
+    <products>
+        <product name="Blowdart">
+            <category>BASE</category>
+        </product>
+        <product name="Pistol">
+            <category>BASE</category>
+        </product>
+        <product name="Shotgun">
+            <category>BASE</category>
+            <available>
+                <addonProduct>Telescopic-Scope</addonProduct>
+                <addonProduct>Laser-Scope</addonProduct>
+                <addonProduct>Holster</addonProduct>
+            </available>
+        </product>
+        <product name="Assault-Rifle">
+            <category>BASE</category>
+            <included>
+                <addonProduct>Telescopic-Scope</addonProduct>
+            </included>
+            <available>
+                <addonProduct>Laser-Scope</addonProduct>
+            </available>
+        </product>
+        <product name="Telescopic-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Laser-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Holster">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Extra-Ammo">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Refurbish-Maintenance">
+            <category>ADD_ON</category>
+        </product>
+    </products>
 
-	<plans>
-		<plan name="pistol-monthly">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice> <!-- empty price implies $0 -->
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>GBP</currency>
-						<value>29.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>29.95</value>
-					</price>
-					<price>
-						<currency>USD</currency>
-						<value>29.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-monthly">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice></fixedPrice>
-					<!-- no price implies $0 -->
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-					<number>-1</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>249.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>149.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>169.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-monthly">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>599.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>349.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>399.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="pistol-annual">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>2399.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>1499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>1699.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>5999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>3499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>3999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="pistol-annual-gunclub-discount">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>9.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>9.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>9.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual-gunclub-discount">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>19.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>49.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>69.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>2399.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>1499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>1699.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual-gunclub-discount">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>99.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>99.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>99.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>5999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>3499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>3999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="laser-scope-monthly">
-			<product>Laser-Scope</product>
-			<initialPhases>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>1</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>999.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>499.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>999.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>1999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>1499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>1999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="telescopic-scope-monthly">
-			<product>Telescopic-Scope</product>
-			<initialPhases>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>1</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>399.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>299.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>399.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="extra-ammo-monthly">
-			<product>Extra-Ammo</product>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-			<plansAllowedInBundle>-1</plansAllowedInBundle> <!-- arbitrary number of these (multipack) -->
-		</plan>
-		<plan name="holster-monthly-regular">
-			<product>Holster</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="holster-monthly-special">
-			<product>Holster</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual-rescue">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>YEARS</unit>
-						<number>1</number>
-					</duration>
-					<billingPeriod>ANNUAL</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>5999.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>3499.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>3999.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>5999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>3499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>3999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="refurbish-maintenance">
-			<product>Refurbish-Maintenance</product>
-			<finalPhase type="FIXEDTERM">
-				<duration>
-					<unit>MONTHS</unit>
-					<number>12</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-				<fixedPrice>
-					<price>
-						<currency>USD</currency>
-						<value>599.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>599.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>599.95</value>
-					</price>
-				</fixedPrice>
-			</finalPhase>
-		</plan>
-	</plans>
-	<priceLists>
-		<defaultPriceList name="DEFAULT">
-			<plans>
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>assault-rifle-monthly</plan>
-				<plan>pistol-annual</plan>
-				<plan>shotgun-annual</plan>
-				<plan>assault-rifle-annual</plan>
-				<plan>laser-scope-monthly</plan>
-				<plan>telescopic-scope-monthly</plan>
-				<plan>extra-ammo-monthly</plan>
-				<plan>holster-monthly-regular</plan>
-				<plan>refurbish-maintenance</plan>
-			</plans>
-		</defaultPriceList>
-		<childPriceList name="gunclubDiscount">
-			<plans>
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>assault-rifle-monthly</plan>
-				<plan>pistol-annual-gunclub-discount</plan>
-				<plan>shotgun-annual-gunclub-discount</plan>
-				<plan>assault-rifle-annual-gunclub-discount</plan>
-				<plan>holster-monthly-special</plan>
-			</plans>
-		</childPriceList>
-		<childPriceList name="rescue">
-			<plans>
-				<plan>assault-rifle-annual-rescue</plan>
-			</plans>
-		</childPriceList>
-	</priceLists>
+    <rules>
+        <changePolicy>
+            <changePolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <toProduct>Assault-Rifle</toProduct>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <fromProduct>Pistol</fromProduct>
+                <toProduct>Shotgun</toProduct>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <toPriceList>rescue</toPriceList>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <fromBillingPeriod>MONTHLY</fromBillingPeriod>
+                <toBillingPeriod>ANNUAL</toBillingPeriod>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <fromBillingPeriod>ANNUAL</fromBillingPeriod>
+                <toBillingPeriod>MONTHLY</toBillingPeriod>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+        </changePolicy>
+        <changeAlignment>
+            <changeAlignmentCase>
+                <toPriceList>rescue</toPriceList>
+                <alignment>CHANGE_OF_PLAN</alignment>
+            </changeAlignmentCase>
+            <changeAlignmentCase>
+                <fromPriceList>rescue</fromPriceList>
+                <toPriceList>rescue</toPriceList>
+                <alignment>CHANGE_OF_PRICELIST</alignment>
+            </changeAlignmentCase>
+            <changeAlignmentCase>
+                <alignment>START_OF_SUBSCRIPTION</alignment>
+            </changeAlignmentCase>
+        </changeAlignment>
+        <cancelPolicy>
+            <cancelPolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </cancelPolicyCase>
+            <cancelPolicyCase>
+                <policy>END_OF_TERM</policy>
+            </cancelPolicyCase>
+        </cancelPolicy>
+        <createAlignment>
+            <createAlignmentCase>
+                <product>Laser-Scope</product>
+                <alignment>START_OF_SUBSCRIPTION</alignment>
+            </createAlignmentCase>
+            <createAlignmentCase>
+                <alignment>START_OF_BUNDLE</alignment>
+            </createAlignmentCase>
+        </createAlignment>
+        <billingAlignment>
+            <billingAlignmentCase>
+                <productCategory>ADD_ON</productCategory>
+                <alignment>BUNDLE</alignment>
+            </billingAlignmentCase>
+            <billingAlignmentCase>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <alignment>SUBSCRIPTION</alignment>
+            </billingAlignmentCase>
+            <billingAlignmentCase>
+                <alignment>ACCOUNT</alignment>
+            </billingAlignmentCase>
+        </billingAlignment>
+        <priceList>
+            <priceListCase>
+                <fromPriceList>rescue</fromPriceList>
+                <toPriceList>DEFAULT</toPriceList>
+            </priceListCase>
+        </priceList>
+    </rules>
+
+    <plans>
+        <plan name="blowdart-monthly">
+            <product>Blowdart</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>USD</currency>
+                                <value>9.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>9.95</value>
+                            </price>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>9.95</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>29.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>29.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>29.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+
+        <plan name="pistol-monthly">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>29.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>29.95</value>
+                    </price>
+                    <price>
+                        <currency>USD</currency>
+                        <value>29.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-monthly">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                    <number>-1</number>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>249.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>149.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>169.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-monthly">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>599.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>349.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>399.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="pistol-quarterly">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>QUARTERLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>69.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>69.95</value>
+                    </price>
+                    <price>
+                        <currency>USD</currency>
+                        <value>69.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="pistol-annual">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+<recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+</recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>2399.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>1499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>1699.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>5999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>3999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="pistol-annual-gunclub-discount">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>9.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>9.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>9.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual-gunclub-discount">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>19.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>49.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>69.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>2399.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>1499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>1699.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual-gunclub-discount">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>99.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>99.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>99.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>5999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>3999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="laser-scope-monthly">
+            <product>Laser-Scope</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>999.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>1999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>1499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>1999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="telescopic-scope-monthly">
+            <product>Telescopic-Scope</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>399.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>299.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>399.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="extra-ammo-monthly">
+            <product>Extra-Ammo</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+            <plansAllowedInBundle>-1</plansAllowedInBundle>
+            <!-- arbitrary number of these (multipack) -->
+        </plan>
+        <plan name="holster-monthly-regular">
+            <product>Holster</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="holster-monthly-special">
+            <product>Holster</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual-rescue">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>YEARS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>5999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>3499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>3999.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>5999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>3999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="refurbish-maintenance">
+            <product>Refurbish-Maintenance</product>
+            <finalPhase type="FIXEDTERM">
+                <duration>
+                    <unit>MONTHS</unit>
+                    <number>12</number>
+                </duration>
+                <fixed>
+                    <fixedPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>599.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>599.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>599.95</value>
+                        </price>
+                    </fixedPrice>
+                </fixed>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>blowdart-monthly</plan>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>assault-rifle-monthly</plan>
+                <plan>pistol-annual</plan>
+                <plan>pistol-quarterly</plan>
+                <plan>shotgun-annual</plan>
+                <plan>assault-rifle-annual</plan>
+                <plan>laser-scope-monthly</plan>
+                <plan>telescopic-scope-monthly</plan>
+                <plan>extra-ammo-monthly</plan>
+                <plan>holster-monthly-regular</plan>
+                <plan>refurbish-maintenance</plan>
+            </plans>
+        </defaultPriceList>
+        <childPriceList name="gunclubDiscount">
+            <plans>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>assault-rifle-monthly</plan>
+                <plan>pistol-annual-gunclub-discount</plan>
+                <plan>shotgun-annual-gunclub-discount</plan>
+                <plan>assault-rifle-annual-gunclub-discount</plan>
+                <plan>holster-monthly-special</plan>
+            </plans>
+        </childPriceList>
+        <childPriceList name="rescue">
+            <plans>
+                <plan>assault-rifle-annual-rescue</plan>
+            </plans>
+        </childPriceList>
+    </priceLists>
 
 </catalog>
diff --git a/junction/src/test/resources/catalog.xml b/junction/src/test/resources/catalog.xml
index 973afd0..0221374 100644
--- a/junction/src/test/resources/catalog.xml
+++ b/junction/src/test/resources/catalog.xml
@@ -1,12 +1,19 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- ~ Copyright 2010-2011 Ning, Inc. ~ ~ Ning licenses this file to you 
-	under the Apache License, version 2.0 ~ (the "License"); you may not use 
-	this file except in compliance with the ~ License. You may obtain a copy 
-	of the License at: ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless 
-	required by applicable law or agreed to in writing, software ~ distributed 
-	under the License is distributed on an "AS IS" BASIS, WITHOUT ~ WARRANTIES 
-	OR CONDITIONS OF ANY KIND, either express or implied. See the ~ License for 
-	the specific language governing permissions and limitations ~ under the License. -->
+<!--
+  ~ Copyright 2010-2013 Ning, Inc.
+  ~
+  ~ Ning licenses this file to you under the Apache License, version 2.0
+  ~ (the "License"); you may not use this file except in compliance with the
+  ~ License.  You may obtain a copy of the License at:
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+  ~ License for the specific language governing permissions and limitations
+  ~ under the License.
+  -->
 
 <!-- Use cases covered so far: Tiered Product (Pistol/Shotgun/Assault-Rifle) 
 	Multiple changeEvent plan policies Multiple PlanAlignment (see below, trial 
@@ -17,812 +24,976 @@
 	and a one off (refurbish-maintenance) Phan with more than 2 phase (gunclub 
 	discount plans) Use Cases to do: Tiered Add On Riskfree period -->
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
-	<effectiveDate>2011-01-01T00:00:00+00:00</effectiveDate>
-	<catalogName>Firearms</catalogName>
+    <effectiveDate>2011-01-01T00:00:00+00:00</effectiveDate>
+    <catalogName>Firearms</catalogName>
 
-	<currencies>
-		<currency>USD</currency>
-		<currency>EUR</currency>
-		<currency>GBP</currency>
-	</currencies>
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
 
-	<products>
-		<product name="Pistol">
-			<category>BASE</category>
-		</product>
-		<product name="Shotgun">
-			<category>BASE</category>
-			<available>
-				<addonProduct>Telescopic-Scope</addonProduct>
-				<addonProduct>Laser-Scope</addonProduct>
-			</available>
-		</product>
-		<product name="Assault-Rifle">
-			<category>BASE</category>
-			<included>
-				<addonProduct>Telescopic-Scope</addonProduct>
-			</included>
-			<available>
-				<addonProduct>Laser-Scope</addonProduct>
-			</available>
-		</product>
-		<product name="Telescopic-Scope">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Laser-Scope">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Holster">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Extra-Ammo">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Refurbish-Maintenance">
-			<category>ADD_ON</category>
-		</product>
-	</products>
+    <currencies>
+        <currency>USD</currency>
+        <currency>EUR</currency>
+        <currency>GBP</currency>
+    </currencies>
 
-	<rules>
-		<changePolicy>
-			<changePolicyCase>
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-                       <changePolicyCase>
-                                <toPriceList>rescue</toPriceList>
-                                <policy>END_OF_TERM</policy>
-                        </changePolicyCase>
-			<changePolicyCase>
-				<toProduct>Assault-Rifle</toProduct>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-			<changePolicyCase>
-				<fromProduct>Pistol</fromProduct>
-				<toProduct>Shotgun</toProduct>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-			<changePolicyCase>
-				<fromBillingPeriod>MONTHLY</fromBillingPeriod>
-				<toBillingPeriod>ANNUAL</toBillingPeriod>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-			<changePolicyCase>
-				<fromBillingPeriod>ANNUAL</fromBillingPeriod>
-				<toBillingPeriod>MONTHLY</toBillingPeriod>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-			<changePolicyCase>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-		</changePolicy>
-		<changeAlignment>
-			<changeAlignmentCase>
-				<toPriceList>rescue</toPriceList>
-				<alignment>CHANGE_OF_PLAN</alignment>
-			</changeAlignmentCase>
-			<changeAlignmentCase>
-				<fromPriceList>rescue</fromPriceList>
-				<toPriceList>rescue</toPriceList>
-				<alignment>CHANGE_OF_PRICELIST</alignment>
-			</changeAlignmentCase>
-			<changeAlignmentCase>
-				<alignment>START_OF_SUBSCRIPTION</alignment>
-			</changeAlignmentCase>
-		</changeAlignment>
-		<cancelPolicy>
-			<cancelPolicyCase>
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</cancelPolicyCase>
-			<cancelPolicyCase>
-				<policy>END_OF_TERM</policy>
-			</cancelPolicyCase>
-		</cancelPolicy>
-		<createAlignment>
-			<createAlignmentCase>
-				<product>Laser-Scope</product>
-				<alignment>START_OF_SUBSCRIPTION</alignment>
-			</createAlignmentCase>
-			<createAlignmentCase>
-				<alignment>START_OF_BUNDLE</alignment>
-			</createAlignmentCase>
-		</createAlignment>
-		<billingAlignment>
-			<billingAlignmentCase>
-				<productCategory>ADD_ON</productCategory>
-				<alignment>BUNDLE</alignment>
-			</billingAlignmentCase>
-			<billingAlignmentCase>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<alignment>SUBSCRIPTION</alignment>
-			</billingAlignmentCase>
-			<billingAlignmentCase>
-				<alignment>ACCOUNT</alignment>
-			</billingAlignmentCase>
-		</billingAlignment>
-		<priceList>
-			<priceListCase>
-				<fromPriceList>rescue</fromPriceList>
-				<toPriceList>DEFAULT</toPriceList>
-			</priceListCase>
-		</priceList>
-	</rules>
+    <products>
+        <product name="Blowdart">
+            <category>BASE</category>
+        </product>
+        <product name="Pistol">
+            <category>BASE</category>
+        </product>
+        <product name="Shotgun">
+            <category>BASE</category>
+            <available>
+                <addonProduct>Telescopic-Scope</addonProduct>
+                <addonProduct>Laser-Scope</addonProduct>
+                <addonProduct>Holster</addonProduct>
+            </available>
+        </product>
+        <product name="Assault-Rifle">
+            <category>BASE</category>
+            <included>
+                <addonProduct>Telescopic-Scope</addonProduct>
+            </included>
+            <available>
+                <addonProduct>Laser-Scope</addonProduct>
+            </available>
+        </product>
+        <product name="Telescopic-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Laser-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Holster">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Extra-Ammo">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Refurbish-Maintenance">
+            <category>ADD_ON</category>
+        </product>
+    </products>
 
-	<plans>
-		<plan name="pistol-monthly">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice> <!-- empty price implies $0 -->
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>GBP</currency>
-						<value>29.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>29.95</value>
-					</price>
-					<price>
-						<currency>USD</currency>
-						<value>29.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-monthly">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice></fixedPrice>
-					<!-- no price implies $0 -->
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-					<number>-1</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>249.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>149.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>169.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-monthly">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>599.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>349.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>399.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="pistol-annual">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>2399.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>1499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>1699.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>5999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>3499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>3999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="pistol-annual-gunclub-discount">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>9.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>9.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>9.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual-gunclub-discount">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>19.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>49.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>69.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>2399.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>1499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>1699.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual-gunclub-discount">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>99.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>99.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>99.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>5999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>3499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>3999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="laser-scope-monthly">
-			<product>Laser-Scope</product>
-			<initialPhases>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>1</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>999.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>499.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>999.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>1999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>1499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>1999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="telescopic-scope-monthly">
-			<product>Telescopic-Scope</product>
-			<initialPhases>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>1</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>399.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>299.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>399.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="extra-ammo-monthly">
-			<product>Extra-Ammo</product>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-			<plansAllowedInBundle>-1</plansAllowedInBundle> <!-- arbitrary number of these (multipack) -->
-		</plan>
-		<plan name="holster-monthly-regular">
-			<product>Holster</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="holster-monthly-special">
-			<product>Holster</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual-rescue">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>YEARS</unit>
-						<number>1</number>
-					</duration>
-					<billingPeriod>ANNUAL</billingPeriod>
-					<recurringPrice>
-						<price>
-							<currency>USD</currency>
-							<value>5999.95</value>
-						</price>
-						<price>
-							<currency>EUR</currency>
-							<value>3499.95</value>
-						</price>
-						<price>
-							<currency>GBP</currency>
-							<value>3999.95</value>
-						</price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>5999.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>3499.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>3999.95</value>
-					</price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="refurbish-maintenance">
-			<product>Refurbish-Maintenance</product>
-			<finalPhase type="FIXEDTERM">
-				<duration>
-					<unit>MONTHS</unit>
-					<number>12</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price>
-						<currency>USD</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>199.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>199.95</value>
-					</price>
-				</recurringPrice>
-				<fixedPrice>
-					<price>
-						<currency>USD</currency>
-						<value>599.95</value>
-					</price>
-					<price>
-						<currency>EUR</currency>
-						<value>599.95</value>
-					</price>
-					<price>
-						<currency>GBP</currency>
-						<value>599.95</value>
-					</price>
-				</fixedPrice>
-			</finalPhase>
-		</plan>
-	</plans>
-	<priceLists>
-		<defaultPriceList name="DEFAULT">
-			<plans>
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>assault-rifle-monthly</plan>
-				<plan>pistol-annual</plan>
-				<plan>shotgun-annual</plan>
-				<plan>assault-rifle-annual</plan>
-				<plan>laser-scope-monthly</plan>
-				<plan>telescopic-scope-monthly</plan>
-				<plan>extra-ammo-monthly</plan>
-				<plan>holster-monthly-regular</plan>
-				<plan>refurbish-maintenance</plan>
-			</plans>
-		</defaultPriceList>
-		<childPriceList name="gunclubDiscount">
-			<plans>
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>assault-rifle-monthly</plan>
-				<plan>pistol-annual-gunclub-discount</plan>
-				<plan>shotgun-annual-gunclub-discount</plan>
-				<plan>assault-rifle-annual-gunclub-discount</plan>
-				<plan>holster-monthly-special</plan>
-			</plans>
-		</childPriceList>
-		<childPriceList name="rescue">
-			<plans>
-				<plan>assault-rifle-annual-rescue</plan>
-			</plans>
-		</childPriceList>
-	</priceLists>
+    <rules>
+        <changePolicy>
+            <changePolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <toProduct>Assault-Rifle</toProduct>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <fromProduct>Pistol</fromProduct>
+                <toProduct>Shotgun</toProduct>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <toPriceList>rescue</toPriceList>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <fromBillingPeriod>MONTHLY</fromBillingPeriod>
+                <toBillingPeriod>ANNUAL</toBillingPeriod>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <fromBillingPeriod>ANNUAL</fromBillingPeriod>
+                <toBillingPeriod>MONTHLY</toBillingPeriod>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+        </changePolicy>
+        <changeAlignment>
+            <changeAlignmentCase>
+                <toPriceList>rescue</toPriceList>
+                <alignment>CHANGE_OF_PLAN</alignment>
+            </changeAlignmentCase>
+            <changeAlignmentCase>
+                <fromPriceList>rescue</fromPriceList>
+                <toPriceList>rescue</toPriceList>
+                <alignment>CHANGE_OF_PRICELIST</alignment>
+            </changeAlignmentCase>
+            <changeAlignmentCase>
+                <alignment>START_OF_SUBSCRIPTION</alignment>
+            </changeAlignmentCase>
+        </changeAlignment>
+        <cancelPolicy>
+            <cancelPolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </cancelPolicyCase>
+            <cancelPolicyCase>
+                <policy>END_OF_TERM</policy>
+            </cancelPolicyCase>
+        </cancelPolicy>
+        <createAlignment>
+            <createAlignmentCase>
+                <product>Laser-Scope</product>
+                <alignment>START_OF_SUBSCRIPTION</alignment>
+            </createAlignmentCase>
+            <createAlignmentCase>
+                <alignment>START_OF_BUNDLE</alignment>
+            </createAlignmentCase>
+        </createAlignment>
+        <billingAlignment>
+            <billingAlignmentCase>
+                <productCategory>ADD_ON</productCategory>
+                <alignment>BUNDLE</alignment>
+            </billingAlignmentCase>
+            <billingAlignmentCase>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <alignment>SUBSCRIPTION</alignment>
+            </billingAlignmentCase>
+            <billingAlignmentCase>
+                <alignment>ACCOUNT</alignment>
+            </billingAlignmentCase>
+        </billingAlignment>
+        <priceList>
+            <priceListCase>
+                <fromPriceList>rescue</fromPriceList>
+                <toPriceList>DEFAULT</toPriceList>
+            </priceListCase>
+        </priceList>
+    </rules>
+
+    <plans>
+        <plan name="blowdart-monthly">
+            <product>Blowdart</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>USD</currency>
+                                <value>9.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>9.95</value>
+                            </price>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>9.95</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>29.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>29.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>29.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+
+        <plan name="pistol-monthly">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>29.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>29.95</value>
+                    </price>
+                    <price>
+                        <currency>USD</currency>
+                        <value>29.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-monthly">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                    <number>-1</number>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>249.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>149.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>169.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-monthly">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>599.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>349.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>399.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="pistol-quarterly">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>QUARTERLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>69.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>69.95</value>
+                    </price>
+                    <price>
+                        <currency>USD</currency>
+                        <value>69.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="pistol-annual">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+<recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+</recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>2399.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>1499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>1699.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>5999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>3999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="pistol-annual-gunclub-discount">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>9.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>9.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>9.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual-gunclub-discount">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>19.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>49.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>69.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>2399.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>1499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>1699.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual-gunclub-discount">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>99.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>99.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>99.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>5999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>3999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="laser-scope-monthly">
+            <product>Laser-Scope</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>999.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>1999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>1499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>1999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="telescopic-scope-monthly">
+            <product>Telescopic-Scope</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>399.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>299.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>399.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="extra-ammo-monthly">
+            <product>Extra-Ammo</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+            <plansAllowedInBundle>-1</plansAllowedInBundle>
+            <!-- arbitrary number of these (multipack) -->
+        </plan>
+        <plan name="holster-monthly-regular">
+            <product>Holster</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="holster-monthly-special">
+            <product>Holster</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice>
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual-rescue">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>YEARS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>5999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>3499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>3999.95</value>
+                        </price>
+                    </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>5999.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3499.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>3999.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="refurbish-maintenance">
+            <product>Refurbish-Maintenance</product>
+            <finalPhase type="FIXEDTERM">
+                <duration>
+                    <unit>MONTHS</unit>
+                    <number>12</number>
+                </duration>
+                <fixed>
+                    <fixedPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>599.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>599.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>599.95</value>
+                        </price>
+                    </fixedPrice>
+                </fixed>
+                <recurring>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>USD</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>199.95</value>
+                    </price>
+                    <price>
+                        <currency>GBP</currency>
+                        <value>199.95</value>
+                    </price>
+                </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>blowdart-monthly</plan>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>assault-rifle-monthly</plan>
+                <plan>pistol-annual</plan>
+                <plan>pistol-quarterly</plan>
+                <plan>shotgun-annual</plan>
+                <plan>assault-rifle-annual</plan>
+                <plan>laser-scope-monthly</plan>
+                <plan>telescopic-scope-monthly</plan>
+                <plan>extra-ammo-monthly</plan>
+                <plan>holster-monthly-regular</plan>
+                <plan>refurbish-maintenance</plan>
+            </plans>
+        </defaultPriceList>
+        <childPriceList name="gunclubDiscount">
+            <plans>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>assault-rifle-monthly</plan>
+                <plan>pistol-annual-gunclub-discount</plan>
+                <plan>shotgun-annual-gunclub-discount</plan>
+                <plan>assault-rifle-annual-gunclub-discount</plan>
+                <plan>holster-monthly-special</plan>
+            </plans>
+        </childPriceList>
+        <childPriceList name="rescue">
+            <plans>
+                <plan>assault-rifle-annual-rescue</plan>
+            </plans>
+        </childPriceList>
+    </priceLists>
 
 </catalog>