The XML | Insert command, though enabled in all views, can be used in Grid View only. It has a submenu (see screenshot) with which you can insert:
•The XML declaration and node types (Attribute, Element, Text, CDATA, Comment, Processing Instruction) in XML documents;
•DOCTYPE declarations and external DTD declarations in XML documents;
•DTD declarations (ELEMENT, ATTLIST, ENTITY, and NOTATION) in DTD documents and internal DTD declarations of XML documents.