Can we make a generalised schema file by which we can validate only the hierarchy of the target XML file, not the tag names in that XML file?

Luigi Viggiano

Speaking about hierarchy it means that you have defined father elements and child elements. How's possible to check hierarchy without checking tag names? Hierarchy implies tag name checking.

If you don't specify any DTD or XMLSchema the only check done is about the well formedness of the XML. In some way, this can be assimilated to a basic hierarchy check.