public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
List positions = node.getChildren("pos");
if (!positions.isEmpty() && (positions.size() == 2)) {
Node n1 = (Node) positions.get(0);
Node n2 = (Node) positions.get(1);
GeneralDirectPosition p1 = (GeneralDirectPosition) n1.getValue();
GeneralDirectPosition p2 = (GeneralDirectPosition) n2.getValue();
GeneralEnvelope envelope = new GeneralEnvelope(p1, p2);
if (p1.getDimension() == 2 && p1.getDimension() == 2) {
envelope.setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84);