다음 예는 XML 문서에서 XML 선언을 표시합니다.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
다음 그림은 선언에서 작성된 트리 구조를 표시합니다.