20 package net.sf.gridarta.utils;
22 import nu.xom.Element;
23 import nu.xom.Elements;
24 import org.jetbrains.annotations.NotNull;
46 public static Element
getChild(@NotNull
final Element parentElement, @NotNull
final String childName) {
47 final Elements elements = parentElement.getChildElements(childName);
48 if (elements.size() == 0) {
49 throw new IllegalArgumentException(
"child element '" + childName +
"' does not exist");
51 return elements.get(0);