<?xml version="1.0"?> <!DOCTYPE root [ <!ENTITY % deftest "<!ELEMENT test (#PCDATA) >"> <!ENTITY % defmiddle "<!ELEMENT middle (test) >"> <!ENTITY % defroot "<!ELEMENT root (middle) >"> <!ELEMENT root (middle)> <!ELEMENT middle (test)> <!ELEMENT test (#PCDATA)> ]> <root><middle><test>sample</test></middle></root>