The issue is that you have specified the root element 'Myroot' to be in the "http://www.w3.org/2001/06/grammar" namespace, however you haven't specified any of your other child-elements to be in this namespace. So when writing out your model, these child-elements are seen as being in no namespace and are written out as such, using xmlns="" to reset the default namespace.
The only way around is is to specifically set the namespace on all your child-elements as well. Regards. Edwin -- http://www.edankert.com/ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user