XQuery relies on the user to specify the hierarchical processing logic along with the hierarchical logic that builds the XML result. Both must be hierarchically correct and kept in semantic sync to get a valid meaningful answer. This hierarchical processing can be quite tricky.There is no control in XQuery to make sure that the XQuery user specified processing follows hierarchical principles to assure the correct result. XQuery is also not aware of the structure it is processing to help assist with user processing. This structure-aware processing is not possible because the structure being processed may not even be hierarchical even though the result is usually structured XML. The problem is that XQuery was designed to serve both as an XML processor and a relational processor which weakens its processing capabilities for both types of data and being able to detect proper processing when relational and XML processing have different processing principles. SQLfX’s ANSI SQL transparent XML processing can perform correct hierarchical processing from input, through processing to output when it is operating hierarchically. Standard SQL operates hierarchically correct by following the hierarchical relationships that make up the hierarchical structure being processed and. Because SQLfX insures that only hierarchical modeled logical relational and physical XML data structures are processed by SQL, it is always structure-aware insuring the hierarchical processing results and automatically formatted XML output are always correct. This also enables the processing of more powerful hierarchical processing capabilities.