class CategoryPriceNavigationXStreamProvider implements XStreamProvider<PriceTierTree> {

    private XStream provide() {
        if (this.xStream == null) {
            XStream xStream = new XStream(new DomDriver());
            xStream.addPermission(AnyTypePermission.ANY);

            xStream.alias("price-navigation", PriceTierTreeImpl.class);
            xStream.aliasField("currencies", PriceTierTreeImpl.class, "priceMap");
            xStream.alias("currency", Map.Entry.class);
            xStream.alias("name", String.class);
            xStream.alias("price-tiers", List.class);
            xStream.alias("price-tier", PriceTierNode.class);
            xStream.registerConverter(new MapConverter(xStream.getMapper(), "currency", "name", "price-tiers"), 10001);
            xStream.addDefaultImplementation(PriceTierNodeImpl.class, PriceTierNode.class);

            this.xStream = xStream;
        }
        return this.xStream;
    }

}