Since XML is inherentlya sequentialdocument-oriented format and objects are (usually) not, XML data binding mappings oftenmay haveignore difficultysome preserving allof the structural information embedded in an XML document. Specifically, information likesuch as [[comment (computer programming)|comment]]s, XML entity references, and sibling order may fail tonot be preserved in the object representation created by the binding application. ThisHowever, this is not always the case; sufficiently complexpowerful data bindersbinding tools are capable of preserving 100% of the information stored in an XML document.
Similarly, since objects residing in computer memory are not inherently sequentialsequentially stored, and may include links to other objects (including self-referential links), simple XML data binding mappings oftenwill have difficulty preserving all the information about an object when it is marshalled to XML. However, sufficiently powerful data binding tools perform graph structure analysis on objects residing in memory to marshall (cyclic) object graph structures in XML by utilizing standardized XML reference attributes.
==Alternatives==
An alternative approach to automatic data binding relies instead on hand-crafted [[XPath]] expressions that extract the data from XML. This approach has asome numberbenefits, ofbut benefitsalso has some drawbacks. First, the data binding codeapproach only needs proximate knowledge (e.g., topology, tag names, etc.) of the XML tree structure, which developers can determine by looking at the XML data; XML schemas are no longer mandatory. Furthermore, XPath allows the application to bind the relevant data items and filter out everything else, avoiding the unnecessary processing that would be required to completely unmarshall the entire XML document. The drawback of this approach is the lack of automation in implementing the object model and XPath expressions. Instead, the application developers have to create these artifacts manually, which is time consuming, potentially error prone and hampers application maintenance when XML schemas and XML content models are updated. Another drawback is the lack of XML schema verification that XML data bindings typically apply automatically during unmarshalling. Schema validity is typically required in secure applications.