Question: can xml have duplicate elements?
Answer: To an XML parser, the elements <sample/> and <sample></sample> are the same—they're both empty sample elements. When your stylesheet adds an element to the result tree, if it creates no content for that element, it's created an empty element, whether that element type was declared as being empty in a DTD or not.