If you want that your XML document work properly and no problem come with in future.Than your XML document should we valid.We can check your XML document validity by these three ways.
1.Well-Formed XML Files
2.Broken XML Files
3.Valid XML Files
1.Well-Formed XML Files:This method check validity by using some rules that are also followed by other markup languages.These rules are.
1.1 Each XML should have only one root element.
1.2 XML document should be proper nested means that when we open any tag it should be in that manner they are opened.
1.3 If we use entity in the XML document it should be properly referenced in the document.
2. Valid XML Files: If want to made valid XML it should be well formed.Because if it is not well-formed there is much difficult to made valid XML document.To generate valid XML our XML document should be validated.But we know that we can\'t validated our XML document without DTD,internal or external,is referenced for the XML processor (XML processor has the XML document and DTD and processes the information).
3.Broken XML Files: Broken XML Files are those Files not proper satisfy the all rules that are compulsory for file to be Well-Formed and Valid.
We can fix the small errors of those XML document by using some XML editors.