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