# xml/load Read an XML file from disk and parse it into a Deft value. ## Syntax
[xml/load $path ?opts]
## Parameters - `$path` — path to the XML file - `$opts` — same shape selector as `xml/parse` (`%{ :compact false }` / `:tree`) ## Examples
set cfg [get [xml/load "config.xml"] "config"]
[get $cfg "@env"]                    # => "production"
[get [get $cfg "database"] "@host"]  # => "localhost"
## Returns The parsed document (same shapes as `xml/parse`), or `%Err{:message}` for an unreadable file, an unsupported encoding, or malformed XML. Bytes are decoded per the XML rules: a UTF-8 byte order mark (or no declaration) is read as UTF-8, a UTF-16 byte order mark decodes either byte order, and an `ISO-8859-1`/`Latin-1` declaration transcodes. Other declared encodings return `%Err`; UTF-16 without a BOM is not detected. ## See Also `xml/parse`, `xml/stringify`, `xml/pretty`, `fs/read`