anchor.diff:    }
   };
   ----
  +
  +You may have to add annotations like `@JsonProperty` and `@JsonIgnore` to your domain object classes to get XML
  +that validates against your schema.
  
positive.code:   void addTo(XmlBuilder<Void> builder);
  
  }
  ----
  
  If you don't like to change your existing domain object classes by having them implement the `Aiu` interface, you
  can replace the polymorphic call to `Aiu.addTo()` with explicit type checking:
  
  [source,java]
  ----
  PdiAssembler<Object> pdiAssembler = new XmlPdiAssembler<Object>(NAMESPACE, "aiu") {
    @Override
    protected void doAdd(Object domainObject, Map<String, ContentInfo> ignored) {
      if (domainObject instanceof Person) {
        Person person = (Person)domainObject;
        // Type-safe code for adding a Person
      } else if (domainObject instanceof Animal) {
        Animal animal = (Animal)domainObject;
        // Type-safe code for adding an Animal
      }
    }
  };
  ----
  
  This may get a little convoluted, in which case you may want to extract the code for each type of domain object into
  a separate method or even class.
  
  
  == Option 3: One serialization method for multiple domain objects
  
  Another option is a hybrid of the previous two options: you keep multiple domain objects, but use a single
  serialization method that works for all of them. This isn't always possible, but when it is, it offers the best of both
  worlds: multiple domain objects that provide type-safe access and a single block of code for serialization.
  
  Here's an example using Jackson's 
  `https://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.9/com/fasterxml/jackson/dataformat/xml/XmlMapper.html[XmlMapper]`:
  
negative.code: same PDI?
  
  
  == Option 1: Multiple domain objects
  
  The simplest solution is to explicitly check which type of domain object is being added to the PDI:
  
  [source,java]
  ----
  PdiAssembler<Object> pdiAssembler = new XmlPdiAssembler<Object>(NAMESPACE, "aiu") {
    @Override
    protected void doAdd(Object domainObject, Map<String, ContentInfo> ignored) {
      if (domainObject instanceof Person) {
        Person person = (Person)domainObject;
        // Type-safe code for adding a Person
      } else if (domainObject instanceof Animal) {
        Animal animal = (Animal)domainObject;
        // Type-safe code for adding an Animal
      } else {
        throw new IllegalArgumentException("Not an AIU: " + domainObject.getClass().getName());
      }
    }
  };
  ----
  
  The downside of this approach is that the compiler can't help you anymore, unless all your domain objects share a
  common ancestor. This means you can run into problems at runtime rather than at compile time, and you may have to throw
  an exception when an incorrect type of object is passed in.
  
  Another disadvantage is that the code may get a little convoluted, in which case you may want to extract the code for
  each type of domain object into a separate method or even class. You can take that to it's logical extreme by 
  introducing a new `Aiu` interface that all your domain objects implement:
  
  [source,java]
  ----
  