XML declaration is optional and its refers to version and encoding of the XML document.
<?xml version="1.0" encoding="ISO-8859-15"?> <address> <name>Alex</name> <company>w3schools</company> <phone>(091) 123-4567</phone> </address>
<?xml version="1.0" encoding="ISO-8859-15"?>
- Declaration of XML is also called the XML prolog.
- prolog of XML is case sensitive and must be written in lower-case.
- XML prolog is optional but if exist then it must be in first line of the document.
- To avoid errors, encoding should be used, or XML file must be save as UTF-8.
- The default character encoding for XML documents is UTF-8.