If you are using the IntelliJ IDEA IDE for NetKernel development, you can make use of the built-in Live Templates feature, plus this NetKernel templates repository to get a helping hand with inserting common xml and java fragments.
Full details on how to install the NetKernel live templates in your IDEA application are given in the repo’s README on GitHub.
Once set up, just place your cursor in the xml or java file where you want to insert the snippet, start typing nk
then press the Tab key to see all of the available snippets that are appropriate for the type of file you are currently editing.