NCX generation code.